X Tutup
Skip to content

Commit 9a9b7f5

Browse files
committed
fix bizarre edge case where import completion would crash if "cw" argument was
None - here's the recipe I had that broke it import pdb def foo(): import pdb; pdb.set_trace( If I change *anything* about that recipe, it doesn't break. Who the hell knows why. Who the hell cares. It works. \o/
1 parent 2c8612f commit 9a9b7f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bpython/importcompletion.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
def complete(line, cw):
3434
"""Construct a full list of possibly completions for imports."""
35+
if not cw:
36+
return None
37+
3538
tokens = line.split()
3639
if tokens[0] not in ['from', 'import']:
3740
return list()

0 commit comments

Comments
 (0)
X Tutup