Skip to content

Commit 8e08f3a

Browse files
Found an even better way. useNameSubname = 4
1 parent 6eff3b2 commit 8e08f3a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

bpython/importcompletion.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ def find_modules(path):
140140
nameSubname = []
141141

142142
#Decides if you are using the first method: usng name subname (1),
143-
# the second method: using pathname (2) or the original (3)
143+
# the second method: using pathname (2) or the original (3), os.realpath
144144
global useNameSubname
145-
useNameSubname = 3
145+
useNameSubname = 4
146146
#print("useNameSubname:", useNameSubname)
147147

148148
if not os.path.isdir(path):
@@ -217,6 +217,12 @@ def find_modules(path):
217217
pathGood = False
218218
#print(pathGood)
219219
#print()
220+
elif useNameSubname == 4:
221+
pathGood = True
222+
pathReal = os.path.realpath(pathname)
223+
if len(pathReal) < len(pathname) and pathReal in pathname:
224+
#print("PathReal:", pathReal, "Path:", pathname)
225+
pathGood = False
220226
if useNameSubname == 1 or pathGood:
221227
for subname in find_modules(pathname):
222228
if subname != "__init__":

0 commit comments

Comments
 (0)