From: Samuele P. <ped...@us...> - 2001-06-14 19:40:04
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv24472 Modified Files: PyModule.java imp.java Log Message: fix for [ #415933 ] dependency problem with jythonc. Oddly enough, it was a core problem: at some point the None used as mark in sys.modules to speed-dup relative imports, were blindly returned by imports instead of raising proper import errors. Index: PyModule.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyModule.java,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -r2.8 -r2.9 *** PyModule.java 2001/02/02 09:28:37 2.8 --- PyModule.java 2001/06/14 19:40:01 2.9 *************** *** 27,31 **** PyObject ret = modules.__finditem__(fullName); ! if (ret != null) return ret; if (path == Py.None) { --- 27,32 ---- PyObject ret = modules.__finditem__(fullName); ! if (ret == Py.None) ret = null; ! else if (ret != null) return ret; if (path == Py.None) { Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v retrieving revision 2.45 retrieving revision 2.46 diff -C2 -r2.45 -r2.46 *** imp.java 2001/06/13 20:44:33 2.45 --- imp.java 2001/06/14 19:40:01 2.46 *************** *** 452,457 **** PyObject modules = Py.getSystemState().modules; PyObject mod = modules.__finditem__(name); ! if (mod != null && !top) ! return mod; int last_dot = dot; --- 452,457 ---- PyObject modules = Py.getSystemState().modules; PyObject mod = modules.__finditem__(name); ! if (mod == Py.None) mod = null; ! else if (mod != null && !top) return mod; int last_dot = dot; *************** *** 505,509 **** String newName = (pkgName+'.'+name).intern(); mod = modules.__finditem__(newName); ! if (mod != null) { //System.err.println("refound: "+name); // ?? dbg if (!top) return mod; --- 505,509 ---- String newName = (pkgName+'.'+name).intern(); mod = modules.__finditem__(newName); ! if (mod != null && mod != Py.None) { //System.err.println("refound: "+name); // ?? dbg if (!top) return mod; |