From: <pj...@us...> - 2008-07-12 00:53:45
|
Revision: 4897 http://jython.svn.sourceforge.net/jython/?rev=4897&view=rev Author: pjenvey Date: 2008-07-11 17:53:44 -0700 (Fri, 11 Jul 2008) Log Message: ----------- fake reload(sys), like reload(PyJavaClass). fix ClassCastException in reload Modified Paths: -------------- branches/asm/src/org/python/core/__builtin__.java Modified: branches/asm/src/org/python/core/__builtin__.java =================================================================== --- branches/asm/src/org/python/core/__builtin__.java 2008-07-12 00:33:21 UTC (rev 4896) +++ branches/asm/src/org/python/core/__builtin__.java 2008-07-12 00:53:44 UTC (rev 4897) @@ -94,7 +94,10 @@ if (o == Py.NoConversion) { o = arg1.__tojava__(PyJavaClass.class); if (o == Py.NoConversion) { - Py.TypeError("reload() argument must be a module"); + if (arg1 instanceof PySystemState) { + return __builtin__.reload((PySystemState)arg1); + } + throw Py.TypeError("reload() argument must be a module"); } return __builtin__.reload((PyJavaClass) o); } @@ -988,6 +991,11 @@ return imp.reload(o); } + public static PyObject reload(PySystemState o) { + // fake it like imp.reload(PyJavaClass) does + return o; + } + public static PyString repr(PyObject o) { return o.__repr__(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |