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,7 +49,14 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: | ||
|
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' | |||
52 | self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE) |
|
60 | self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE) | |
53 |
|
61 | |||
54 | # call up the chain |
|
62 | # call up the chain |
General Comments 0
You need to be logged in to leave comments.
Login now