Skip to content

Commit 399692f

Browse files
committed
fixed "from ..." import completion
1 parent 7f9a9b2 commit 399692f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bpython/importcompletion.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,17 @@ def complete(line, cw):
3434
"""Construct a full list of possibly completions for imports."""
3535
tokens = line.split()
3636
if tokens[0] in ['from', 'import']:
37+
completing_from = False
3738
if tokens[0] == 'from':
38-
completing_from = True
3939
if len(tokens) > 3:
4040
if '.' in cw:
4141
# This will result in a SyntaxError, so do not return
4242
# any matches
4343
return list()
44+
completing_from = True
4445
cw = '%s.%s' % (tokens[1], cw)
4546
elif len(tokens) == 3:
4647
return ['import']
47-
else:
48-
completing_from = False
4948

5049
matches = list()
5150
for name in modules:

0 commit comments

Comments
 (0)