##// END OF EJS Templates
introduce UsageError
vivainio -
Show More
@@ -86,6 +86,13 b' class TryNext(Exception):'
86 86 self.args = args
87 87 self.kwargs = kwargs
88 88
89 class UsageError(Exception):
90 """ Error in magic function arguments, etc.
91
92 Something that probably won't warrant a full traceback, but should
93 nevertheless interrupt a macro / batch file.
94 """
95
89 96 class IPyAutocall:
90 97 """ Instances of this class are always autocalled
91 98
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.'
6 6
7 7 This file contains all the classes and helper functions specific to IPython.
8 8
9 $Id: iplib.py 2725 2007-09-07 08:59:10Z vivainio $
9 $Id: iplib.py 2746 2007-09-08 14:00:21Z vivainio $
10 10 """
11 11
12 12 #*****************************************************************************
@@ -471,7 +471,7 b' class InteractiveShell(object,Magic):'
471 471 except HomeDirError,msg:
472 472 fatal(msg)
473 473
474 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
474 self.dir_stack = []
475 475
476 476 # Functions to call the underlying shell.
477 477
@@ -1488,6 +1488,8 b' want to merge them back into the new files.""" % locals()'
1488 1488
1489 1489 if etype is SyntaxError:
1490 1490 self.showsyntaxerror(filename)
1491 elif etype is IPython.ipapi.UsageError:
1492 print "UsageError:", value
1491 1493 else:
1492 1494 # WARNING: these variables are somewhat deprecated and not
1493 1495 # necessarily safe to use in a threaded environment, but tools
General Comments 0
You need to be logged in to leave comments. Login now