Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14)

Side by Side Diff: src/org/python/core/exceptions.java

Issue 2810: SystemRestart exception to restart the interpreter (Closed) SVN Base: https://jython.svn.sourceforge.net/svnroot/jython/branches/asm
Patch Set: Created 1 year, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2001 Finn Bock 1 // Copyright 2001 Finn Bock
2 package org.python.core; 2 package org.python.core;
3 3
4 import java.io.File; 4 import java.io.File;
5 import java.lang.reflect.Method; 5 import java.lang.reflect.Method;
6 6
7 import org.python.modules.zipimport.zipimport; 7 import org.python.modules.zipimport.zipimport;
8 8
9 /** 9 /**
10 * The builtin exceptions module. The entire module should be imported from 10 * The builtin exceptions module. The entire module should be imported from
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // XXX: 44 // XXX:
45 PyObject baseExcDict = PyBaseException.TYPE.fastGetDict(); 45 PyObject baseExcDict = PyBaseException.TYPE.fastGetDict();
46 baseExcDict.__setitem__("__doc__", Py.newString("Common base class for a ll exceptions")); 46 baseExcDict.__setitem__("__doc__", Py.newString("Common base class for a ll exceptions"));
47 dict.__setitem__("BaseException", PyBaseException.TYPE); 47 dict.__setitem__("BaseException", PyBaseException.TYPE);
48 48
49 buildClass(dict, "KeyboardInterrupt", "BaseException", "Program interrup ted by user."); 49 buildClass(dict, "KeyboardInterrupt", "BaseException", "Program interrup ted by user.");
50 50
51 buildClass(dict, "SystemExit", "BaseException", SystemExit(), 51 buildClass(dict, "SystemExit", "BaseException", SystemExit(),
52 "Request to exit from the interpreter."); 52 "Request to exit from the interpreter.");
53
54 buildClass(dict, "SystemRestart", "BaseException",
55 "Request to restart the interpreter. (Jython-specific)");
53 56
54 buildClass(dict, "Exception", "BaseException", 57 buildClass(dict, "Exception", "BaseException",
55 "Common base class for all non-exit exceptions."); 58 "Common base class for all non-exit exceptions.");
56 59
57 buildClass(dict, "StandardError", "Exception", 60 buildClass(dict, "StandardError", "Exception",
58 "Base class for all standard Python exceptions that do not re present\n" 61 "Base class for all standard Python exceptions that do not re present\n"
59 + "interpreter exiting."); 62 + "interpreter exiting.");
60 63
61 buildClass(dict, "SyntaxError", "StandardError", SyntaxError(), "Invalid syntax."); 64 buildClass(dict, "SyntaxError", "StandardError", SyntaxError(), "Invalid syntax.");
62 65
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 677
675 public PyObject __call__(PyObject[] args, String kwargs[]) { 678 public PyObject __call__(PyObject[] args, String kwargs[]) {
676 try { 679 try {
677 return Py.java2py(javaMethod.invoke(null, self, args, kwargs)); 680 return Py.java2py(javaMethod.invoke(null, self, args, kwargs));
678 } catch (Throwable t) { 681 } catch (Throwable t) {
679 throw Py.JavaError(t); 682 throw Py.JavaError(t);
680 } 683 }
681 } 684 }
682 } 685 }
683 } 686 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r483