From 8b3f09efef62d9864957018e5b957d19bb5d7fe5 2006-11-03 07:45:13 From: fptest Date: 2006-11-03 07:45:13 Subject: [PATCH] Fix local variable error. --- diff --git a/IPython/Extensions/ipy_stock_completers.py b/IPython/Extensions/ipy_stock_completers.py index 7bfaa21..2a7ef8e 100755 --- a/IPython/Extensions/ipy_stock_completers.py +++ b/IPython/Extensions/ipy_stock_completers.py @@ -96,13 +96,13 @@ def runlistpy(self, event): relpath = (len(comps) > 1 and comps[-1] or '') #print "rp",relpath # dbg - glob = glob.glob + lglob = glob.glob isdir = os.path.isdir if relpath.startswith('~'): relpath = os.path.expanduser(relpath) - dirs = [f.replace('\\','/') + "/" for f in glob(relpath+'*') + dirs = [f.replace('\\','/') + "/" for f in lglob(relpath+'*') if isdir(f)] - pys = [f.replace('\\','/') for f in glob(relpath+'*.py')] + pys = [f.replace('\\','/') for f in lglob(relpath+'*.py')] return dirs + pys ip.set_hook('complete_command', runlistpy, str_key = '%run')