From b3547d9de710c3ec242c7ab6af139461a0cbe459 2007-03-19 03:33:57 From: fperez Date: 2007-03-19 03:33:57 Subject: [PATCH] - Fix recursion issue in previous commit. --- diff --git a/IPython/completer.py b/IPython/completer.py index f6470c0..33d7a80 100644 --- a/IPython/completer.py +++ b/IPython/completer.py @@ -384,8 +384,12 @@ class IPCompleter(Completer): if d[-1] in ['/','\\']: d = d[:-1] - matches = [ (d + '/' + p) for p in os.listdir(d) ] - return single_dir_expand(matches) + subdirs = os.listdir(d) + if subdirs: + matches = [ (d + '/' + p) for p in subdirs] + return single_dir_expand(matches) + else: + return matches else: return matches @@ -437,6 +441,7 @@ class IPCompleter(Completer): matches = [text_prefix + protect_filename(f) for f in m0] + print 'mm',matches # dbg return single_dir_expand(matches) def alias_matches(self, text):