Skip to content

Commit 1da00a1

Browse files
committed
fix Trundle and bobf being silly and writing code backwards (or drunk, in
bobf's case)
1 parent 1017431 commit 1da00a1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

bpython/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,12 @@ def _complete(self, unused_tab=False):
608608
# Check for import completion
609609
e = False
610610
matches = importcompletion.complete(self.s, cw)
611-
if matches is None:
611+
if matches is not None and not matches:
612612
self.matches = []
613613
self.scr.redrawwin()
614614
return False
615615

616-
if not matches:
616+
if matches is None:
617617
# Nope, no import, continue with normal completion
618618
try:
619619
self.completer.complete(cw, 0)

bpython/importcompletion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ def complete(line, cw):
3737

3838
tokens = line.split()
3939
if tokens[0] not in ['from', 'import']:
40-
return list()
40+
return None
4141

4242
completing_from = False
4343
if tokens[0] == 'from':
4444
if len(tokens) > 3:
4545
if '.' in cw:
4646
# This will result in a SyntaxError, so do not return
4747
# any matches
48-
return list()
48+
return None
4949
completing_from = True
5050
cw = '%s.%s' % (tokens[1], cw)
5151
elif len(tokens) == 3:
@@ -59,7 +59,7 @@ def complete(line, cw):
5959
name = name[len(tokens[1]) + 1:]
6060
matches.append(name)
6161
if not matches:
62-
return None
62+
return []
6363
return matches
6464

6565

0 commit comments

Comments
 (0)