From: Finn B. <bc...@us...> - 2001-12-27 15:21:03
|
Update of /cvsroot/jython/jython/org/python/modules In directory usw-pr-cvs1:/tmp/cvs-serv6082 Modified Files: imp.java Log Message: Moved the sys.path default value into the 2 arg version of find_module to support an explicit None argument. Fix for bug "[ #495604 ] imp.find_module fails when None is 2 arg". Index: imp.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/modules/imp.java,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** imp.java 2001/03/13 20:27:30 2.5 --- imp.java 2001/12/27 15:21:00 2.6 *************** *** 24,32 **** public static PyObject find_module(String name) { ! return find_module(name, Py.getSystemState().__getattr__("path")); } public static PyObject find_module(String name, PyObject path) { PyObject p = null; for (int i = 0; (p = path.__finditem__(i)) != null; i++) { --- 24,34 ---- public static PyObject find_module(String name) { ! return find_module(name, null); } public static PyObject find_module(String name, PyObject path) { + if (path == null || path == Py.None) + path = Py.getSystemState().__getattr__("path"); PyObject p = null; for (int i = 0; (p = path.__finditem__(i)) != null; i++) { |