Show More
@@ -737,7 +737,7 b' class InteractiveShell(Configurable, Magic):' | |||
|
737 | 737 | else: |
|
738 | 738 | # fallback to our internal debugger |
|
739 | 739 | pm = lambda : self.InteractiveTB.debugger(force=True) |
|
740 | self.history_saving_wrapper(pm)() | |
|
740 | pm() | |
|
741 | 741 | |
|
742 | 742 | #------------------------------------------------------------------------- |
|
743 | 743 | # Things related to IPython's various namespaces |
@@ -1250,26 +1250,6 b' class InteractiveShell(Configurable, Magic):' | |||
|
1250 | 1250 | """Sets up the command history, and starts regular autosaves.""" |
|
1251 | 1251 | self.history_manager = HistoryManager(shell=self, config=self.config) |
|
1252 | 1252 | |
|
1253 | def history_saving_wrapper(self, func): | |
|
1254 | """ Wrap func for readline history saving | |
|
1255 | ||
|
1256 | Convert func into callable that saves & restores | |
|
1257 | history around the call """ | |
|
1258 | ||
|
1259 | if self.has_readline: | |
|
1260 | from IPython.utils import rlineimpl as readline | |
|
1261 | else: | |
|
1262 | return func | |
|
1263 | ||
|
1264 | def wrapper(): | |
|
1265 | self.save_history() | |
|
1266 | try: | |
|
1267 | func() | |
|
1268 | finally: | |
|
1269 | self.reload_history() | |
|
1270 | return wrapper | |
|
1271 | ||
|
1272 | ||
|
1273 | 1253 | #------------------------------------------------------------------------- |
|
1274 | 1254 | # Things related to exception handling and tracebacks (not debugging) |
|
1275 | 1255 | #------------------------------------------------------------------------- |
@@ -2062,7 +2042,7 b' class InteractiveShell(Configurable, Magic):' | |||
|
2062 | 2042 | # raised in user code. It would be nice if there were |
|
2063 | 2043 | # versions of runlines, execfile that did raise, so |
|
2064 | 2044 | # we could catch the errors. |
|
2065 | self.run_cell(thefile.read()) | |
|
2045 | self.run_cell(thefile.read(), store_history=False) | |
|
2066 | 2046 | except: |
|
2067 | 2047 | self.showtraceback() |
|
2068 | 2048 | warn('Unknown failure executing file: <%s>' % fname) |
@@ -1602,8 +1602,6 b' Currently the magic system has the following functions:\\n"""' | |||
|
1602 | 1602 | |
|
1603 | 1603 | stats = None |
|
1604 | 1604 | try: |
|
1605 | #self.shell.save_history() | |
|
1606 | ||
|
1607 | 1605 | if opts.has_key('p'): |
|
1608 | 1606 | stats = self.magic_prun('',0,opts,arg_lst,prog_ns) |
|
1609 | 1607 | else: |
@@ -1720,8 +1718,6 b' Currently the magic system has the following functions:\\n"""' | |||
|
1720 | 1718 | # added. Otherwise it will trap references to objects |
|
1721 | 1719 | # contained therein. |
|
1722 | 1720 | del sys.modules[main_mod_name] |
|
1723 | ||
|
1724 | #self.shell.reload_history() | |
|
1725 | 1721 | |
|
1726 | 1722 | return stats |
|
1727 | 1723 |
General Comments 0
You need to be logged in to leave comments.
Login now