From: <pj...@us...> - 2009-04-16 05:48:48
|
Revision: 6230 http://jython.svn.sourceforge.net/jython/?rev=6230&view=rev Author: pjenvey Date: 2009-04-16 05:48:35 +0000 (Thu, 16 Apr 2009) Log Message: ----------- make BadPickleGet an actual exception Modified Paths: -------------- trunk/jython/src/org/python/modules/cPickle.java Modified: trunk/jython/src/org/python/modules/cPickle.java =================================================================== --- trunk/jython/src/org/python/modules/cPickle.java 2009-04-16 03:11:53 UTC (rev 6229) +++ trunk/jython/src/org/python/modules/cPickle.java 2009-04-16 05:48:35 UTC (rev 6230) @@ -384,11 +384,8 @@ public static PyObject PicklingError; public static PyObject UnpickleableError; public static PyObject UnpicklingError; + public static PyObject BadPickleGet; - public static final PyString BadPickleGet = - new PyString("cPickle.BadPickleGet"); - - final static char MARK = '('; final static char STOP = '.'; final static char POP = '0'; @@ -510,6 +507,7 @@ PicklingError = Py.makeClass("PicklingError", PickleError, exceptionNamespace()); UnpickleableError = Py.makeClass("UnpickleableError", PicklingError, _UnpickleableError()); UnpicklingError = Py.makeClass("UnpicklingError", PickleError, exceptionNamespace()); + BadPickleGet = Py.makeClass("BadPickleGet", UnpicklingError, exceptionNamespace()); } public static PyObject exceptionNamespace() { @@ -2067,16 +2065,18 @@ final private void load_get() { String py_str = file.readlineNoNl(); PyObject value = memo.get(py_str); - if (value == null) + if (value == null) { throw new PyException(BadPickleGet, py_str); + } push(value); } final private void load_binget() { String py_key = String.valueOf((int)file.read(1).charAt(0)); PyObject value = memo.get(py_key); - if (value == null) + if (value == null) { throw new PyException(BadPickleGet, py_key); + } push(value); } @@ -2084,8 +2084,9 @@ int i = read_binint(); String py_key = String.valueOf(i); PyObject value = memo.get(py_key); - if (value == null) + if (value == null) { throw new PyException(BadPickleGet, py_key); + } push(value); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |