Show More
@@ -277,17 +277,14 b' class InteractiveShellApp(Configurable):' | |||
|
277 | 277 | sys.argv = [ py3compat.cast_bytes(a) for a in sys.argv ] |
|
278 | 278 | try: |
|
279 | 279 | if os.path.isfile(full_filename): |
|
280 | self.log.info("Running file in user namespace: %s" % full_filename) | |
|
281 | # Ensure that __file__ is always defined to match Python behavior | |
|
282 | self.shell.user_ns['__file__'] = fname | |
|
283 | try: | |
|
280 | 284 | if full_filename.endswith('.ipy'): |
|
281 | self.log.info("Running file in user namespace: %s" % | |
|
282 | full_filename) | |
|
283 | 285 | self.shell.safe_execfile_ipy(full_filename) |
|
284 | 286 | else: |
|
285 | 287 | # default to python, even without extension |
|
286 | self.log.info("Running file in user namespace: %s" % | |
|
287 | full_filename) | |
|
288 | # Ensure that __file__ is always defined to match Python behavior | |
|
289 | self.shell.user_ns['__file__'] = fname | |
|
290 | try: | |
|
291 | 288 | self.shell.safe_execfile(full_filename, self.shell.user_ns) |
|
292 | 289 |
|
|
293 | 290 |
|
General Comments 0
You need to be logged in to leave comments.
Login now