From 3809249528c9eac2a14107025fc4e7ee43a307d0 2006-10-13 21:29:33 From: vivainio Date: 2006-10-13 21:29:33 Subject: [PATCH] .py is always executable for purposes of %rehashx and %rehashdir --- diff --git a/IPython/Extensions/ext_rehashdir.py b/IPython/Extensions/ext_rehashdir.py index 78ece65..455972d 100644 --- a/IPython/Extensions/ext_rehashdir.py +++ b/IPython/Extensions/ext_rehashdir.py @@ -66,7 +66,9 @@ def rehashdir_f(self,arg): winext = os.environ['pathext'].replace(';','|').replace('.','') except KeyError: winext = 'exe|com|bat|py' - + if 'py' not in winext: + winext += '|py' + execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE) isexec = lambda fname:os.path.isfile(fname) and execre.match(fname) savedir = os.getcwd() diff --git a/IPython/Magic.py b/IPython/Magic.py index 12ac142..4044714 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 1824 2006-10-13 21:07:59Z vivainio $""" +$Id: Magic.py 1825 2006-10-13 21:29:33Z vivainio $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -2460,8 +2460,9 @@ Defaulting color scheme to 'NoColor'""" try: winext = os.environ['pathext'].replace(';','|').replace('.','') except KeyError: - winext = 'exe|com|bat' - + winext = 'exe|com|bat|py' + if 'py' not in winext: + winext += '|py' execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE) isexec = lambda fname:os.path.isfile(fname) and execre.match(fname) savedir = os.getcwd()