From: Finn B. <bc...@us...> - 2001-04-13 18:43:44
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv31763 Modified Files: Py.java Log Message: makeException(): Enforce that instance exception doesn't have a seperate value. Index: Py.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/Py.java,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -r2.41 -r2.42 *** Py.java 2001/03/08 23:43:51 2.41 --- Py.java 2001/04/13 18:43:41 2.42 *************** *** 1030,1033 **** --- 1030,1041 ---- public static PyException makeException(PyObject type, PyObject value) { + if (type instanceof PyInstance) { + if (value != Py.None) { + throw TypeError("instance exceptions may not have " + + "a separate value"); + } else { + return new PyException(type.__class__, type); + } + } PyException exc = new PyException(type, value); exc.instantiate(); *************** *** 1038,1041 **** --- 1046,1059 ---- PyObject traceback) { + if (type instanceof PyInstance) { + if (value != Py.None) { + throw TypeError("instance exceptions may not have " + + "a separate value"); + } else { + type = type.__class__; + //return new PyException(type.__class__, type); + } + } + if (traceback == None) return new PyException(type, value); |