diff options
Diffstat (limited to 'Lib/idlelib/AutoComplete.py')
-rw-r--r-- | Lib/idlelib/AutoComplete.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py index ac0827c..9d9a81e 100644 --- a/Lib/idlelib/AutoComplete.py +++ b/Lib/idlelib/AutoComplete.py @@ -23,6 +23,10 @@ from idlelib.HyperParser import HyperParser import __main__ +SEPS = os.sep +if os.altsep: # e.g. '/' on Windows... + SEPS += os.altsep + class AutoComplete: menudefs = [ @@ -70,7 +74,7 @@ class AutoComplete: if lastchar == ".": self._open_completions_later(False, False, False, COMPLETE_ATTRIBUTES) - elif lastchar == os.sep: + elif lastchar in SEPS: self._open_completions_later(False, False, False, COMPLETE_FILES) @@ -126,7 +130,7 @@ class AutoComplete: i -= 1 comp_start = curline[i:j] j = i - while i and curline[i-1] in FILENAME_CHARS+os.sep: + while i and curline[i-1] in FILENAME_CHARS + SEPS: i -= 1 comp_what = curline[i:j] elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES): |