##// END OF EJS Templates
Merge pull request #12368 from meeseeksmachine/auto-backport-of-pr-12367-on-7.x
Matthias Bussonnier -
r25814:8fd05ccd merge
parent child Browse files
Show More
@@ -25,6 +25,7 b' from IPython.utils.openpy import source_to_unicode'
25 from IPython.utils.process import abbrev_cwd
25 from IPython.utils.process import abbrev_cwd
26 from IPython.utils.terminal import set_term_title
26 from IPython.utils.terminal import set_term_title
27 from traitlets import Bool
27 from traitlets import Bool
28 from warnings import warn
28
29
29
30
30 @magics_class
31 @magics_class
@@ -48,8 +49,15 b' class OSMagics(Magics):'
48 winext = os.environ['pathext'].replace(';','|').replace('.','')
49 winext = os.environ['pathext'].replace(';','|').replace('.','')
49 except KeyError:
50 except KeyError:
50 winext = 'exe|com|bat|py'
51 winext = 'exe|com|bat|py'
51
52 try:
52 self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
53 self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
54 except re.error:
55 warn("Seems like your pathext environmental "
56 "variable is malformed. Please check it to "
57 "enable a proper handle of file extensions "
58 "managed for your system")
59 winext = 'exe|com|bat|py'
60 self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
53
61
54 # call up the chain
62 # call up the chain
55 super().__init__(shell=shell, **kwargs)
63 super().__init__(shell=shell, **kwargs)
General Comments 0
You need to be logged in to leave comments. Login now