Show More
@@ -6,7 +6,7 b' Requires Python 2.1 or better.' | |||||
6 |
|
6 | |||
7 | This file contains the main make_IPython() starter function. |
|
7 | This file contains the main make_IPython() starter function. | |
8 |
|
8 | |||
9 |
$Id: ipmaker.py 13 |
|
9 | $Id: ipmaker.py 1330 2006-05-26 22:34:48Z fperez $""" | |
10 |
|
10 | |||
11 | #***************************************************************************** |
|
11 | #***************************************************************************** | |
12 | # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu> |
|
12 | # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu> | |
@@ -331,11 +331,6 b" object? -> Details about 'object'. ?object also works, ?? prints more." | |||||
331 | mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'), |
|
331 | mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'), | |
332 | qw('classic profile'),qw('classic rcfile')]) |
|
332 | qw('classic profile'),qw('classic rcfile')]) | |
333 |
|
333 | |||
334 | # Fix up sys.argv to omit the ipython call, for consistency with how |
|
|||
335 | # Python itself operates (the inconsistency can break user scripts which |
|
|||
336 | # rely on the Python behavior when run under ipython). |
|
|||
337 | sys.argv[:] = sys.argv[1:] |
|
|||
338 |
|
||||
339 | #--------------------------------------------------------------------------- |
|
334 | #--------------------------------------------------------------------------- | |
340 | # Log replay |
|
335 | # Log replay | |
341 |
|
336 | |||
@@ -702,19 +697,20 b" object? -> Details about 'object'. ?object also works, ?? prints more." | |||||
702 | # directly. This prevents triggering the IPython crash handler. |
|
697 | # directly. This prevents triggering the IPython crash handler. | |
703 | old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook |
|
698 | old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook | |
704 |
|
699 | |||
705 | save_argv = sys.argv[:] # save it for later restoring |
|
700 | save_argv = sys.argv[1:] # save it for later restoring | |
706 |
|
701 | |||
707 | sys.argv = args |
|
702 | sys.argv = args | |
708 |
|
703 | |||
709 | try: |
|
704 | try: | |
710 | IP.safe_execfile(args[0], IP.user_ns) |
|
705 | IP.safe_execfile(args[0], IP.user_ns) | |
711 | finally: |
|
706 | finally: | |
712 | # Reset our crash handler in place |
|
707 | # Reset our crash handler in place | |
713 | sys.excepthook = old_excepthook |
|
708 | sys.excepthook = old_excepthook | |
714 | sys.argv = save_argv |
|
709 | sys.argv[:] = save_argv | |
715 | IP.user_ns['__name__'] = name_save |
|
710 | IP.user_ns['__name__'] = name_save | |
716 |
|
711 | |||
717 | msg.user_exec.release_all() |
|
712 | msg.user_exec.release_all() | |
|
713 | ||||
718 | if IP_rc.messages: |
|
714 | if IP_rc.messages: | |
719 | msg.summary += msg.user_exec.summary_all() |
|
715 | msg.summary += msg.user_exec.summary_all() | |
720 |
|
716 |
General Comments 0
You need to be logged in to leave comments.
Login now