##// 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 25 from IPython.utils.process import abbrev_cwd
26 26 from IPython.utils.terminal import set_term_title
27 27 from traitlets import Bool
28 from warnings import warn
28 29
29 30
30 31 @magics_class
@@ -48,8 +49,15 b' class OSMagics(Magics):'
48 49 winext = os.environ['pathext'].replace(';','|').replace('.','')
49 50 except KeyError:
50 51 winext = 'exe|com|bat|py'
51
52 self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
52 try:
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 62 # call up the chain
55 63 super().__init__(shell=shell, **kwargs)
General Comments 0
You need to be logged in to leave comments. Login now