Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv6409
Modified Files:
imp.java
Log Message:
unnoticed __all__ bug fix
Index: imp.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/imp.java,v
retrieving revision 2.37
retrieving revision 2.38
diff -C2 -r2.37 -r2.38
*** imp.java 2001/02/02 09:28:37 2.37
--- imp.java 2001/02/04 01:05:28 2.38
***************
*** 618,633 ****
}
- // if __all__ is present, things work properly under the assumption
- // that names is sorted (__*__ names come first)
private static void loadNames(PyObject names, PyObject module,
PyObject locals)
{
int i=0;
PyObject name;
while ((name=names.__finditem__(i++)) != null) {
String sname = ((PyString)name).internedString();
! if (sname == "__all__") {
! loadNames(module.__findattr__("__all__"), module, locals);
! } else if (sname.startsWith("__")) {
continue;
} else {
--- 618,631 ----
}
private static void loadNames(PyObject names, PyObject module,
PyObject locals)
{
+ PyObject __all__ = module.__findattr__("__all__");
+ if (__all__ != null) names = __all__;
int i=0;
PyObject name;
while ((name=names.__finditem__(i++)) != null) {
String sname = ((PyString)name).internedString();
! if (sname.startsWith("__")) {
continue;
} else {
|