Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1da00a1

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

2 files changed

+5-5Lines changed: 5 additions & 5 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/cli.py‎

Copy file name to clipboardExpand all lines: bpython/cli.py
+2-2Lines 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)
Collapse file

‎bpython/importcompletion.py‎

Copy file name to clipboardExpand all lines: bpython/importcompletion.py
+3-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.