Skip to content

Commit 513f37d

Browse files
Made variable to store paths for comparison.
1 parent 44f76f7 commit 513f37d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

bpython/importcompletion.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949

5050
# The cached list of all known modules
5151
modules = set()
52+
#List of stored paths
53+
paths = set()
5254
fully_loaded = False
5355

5456

@@ -192,11 +194,9 @@ def find_modules(path):
192194
continue
193195
else:
194196
if is_package:
195-
pathGood = True
196197
pathReal = os.path.realpath(pathname)
197-
if len(pathReal) < len(pathname) and pathReal in pathname:
198-
pathGood = False
199-
if pathGood:
198+
if not pathReal in paths:
199+
paths.add(pathReal)
200200
for subname in find_modules(pathname):
201201
if subname != "__init__":
202202
yield "%s.%s" % (name, subname)

0 commit comments

Comments
 (0)