Show More
@@ -1642,7 +1642,7 b' Currently the magic system has the following functions:\\n"""' | |||
|
1642 | 1642 | return |
|
1643 | 1643 | |
|
1644 | 1644 | # Control the response to exit() calls made by the script being run |
|
1645 |
exit_ignore = |
|
|
1645 | exit_ignore = 'e' in opts | |
|
1646 | 1646 | |
|
1647 | 1647 | # Make sure that the running script gets a proper sys.argv as if it |
|
1648 | 1648 | # were run from a system shell. |
@@ -1653,7 +1653,7 b' Currently the magic system has the following functions:\\n"""' | |||
|
1653 | 1653 | |
|
1654 | 1654 | sys.argv = [filename]+ args # put in the proper filename |
|
1655 | 1655 | |
|
1656 |
if |
|
|
1656 | if 'i' in opts: | |
|
1657 | 1657 | # Run in user's interactive namespace |
|
1658 | 1658 | prog_ns = self.shell.user_ns |
|
1659 | 1659 | __name__save = self.shell.user_ns['__name__'] |
@@ -1661,7 +1661,7 b' Currently the magic system has the following functions:\\n"""' | |||
|
1661 | 1661 | main_mod = self.shell.new_main_mod(prog_ns) |
|
1662 | 1662 | else: |
|
1663 | 1663 | # Run in a fresh, empty namespace |
|
1664 |
if |
|
|
1664 | if 'n' in opts: | |
|
1665 | 1665 | name = os.path.splitext(os.path.basename(filename))[0] |
|
1666 | 1666 | else: |
|
1667 | 1667 | name = '__main__' |
@@ -1690,10 +1690,10 b' Currently the magic system has the following functions:\\n"""' | |||
|
1690 | 1690 | try: |
|
1691 | 1691 | stats = None |
|
1692 | 1692 | with self.readline_no_record: |
|
1693 |
if |
|
|
1693 | if 'p' in opts: | |
|
1694 | 1694 | stats = self.magic_prun('',0,opts,arg_lst,prog_ns) |
|
1695 | 1695 | else: |
|
1696 |
if |
|
|
1696 | if 'd' in opts: | |
|
1697 | 1697 | deb = debugger.Pdb(self.shell.colors) |
|
1698 | 1698 | # reset Breakpoint state, which is moronically kept |
|
1699 | 1699 | # in a class |
@@ -1733,7 +1733,7 b' Currently the magic system has the following functions:\\n"""' | |||
|
1733 | 1733 | else: |
|
1734 | 1734 | if runner is None: |
|
1735 | 1735 | runner = self.shell.safe_execfile |
|
1736 |
if |
|
|
1736 | if 't' in opts: | |
|
1737 | 1737 | # timed execution |
|
1738 | 1738 | try: |
|
1739 | 1739 | nruns = int(opts['N'][0]) |
@@ -1774,7 +1774,7 b' Currently the magic system has the following functions:\\n"""' | |||
|
1774 | 1774 | # regular execution |
|
1775 | 1775 | runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore) |
|
1776 | 1776 | |
|
1777 |
if |
|
|
1777 | if 'i' in opts: | |
|
1778 | 1778 | self.shell.user_ns['__name__'] = __name__save |
|
1779 | 1779 | else: |
|
1780 | 1780 | # The shell MUST hold a reference to prog_ns so after %run |
General Comments 0
You need to be logged in to leave comments.
Login now