Index: jython/src/org/python/core/PyFunction.java =================================================================== --- jython/src/org/python/core/PyFunction.java (revision 3517) +++ jython/src/org/python/core/PyFunction.java (working copy) @@ -14,6 +14,7 @@ public PyCode func_code; public PyObject __dict__; public PyObject func_closure; // nested scopes: closure + public PyObject __module__; public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, PyObject doc,PyObject[] closure_cells) @@ -31,6 +32,7 @@ } else { func_closure = null; } + __module__ = globals.__finditem__("__name__"); } public PyFunction(PyObject globals, PyObject[] defaults, PyCode code, @@ -51,7 +53,7 @@ private static final String[] __members__ = { "__doc__", "func_doc", - "__name__", "func_name", "__dict__", + "__name__", "func_name", "__dict__", "__module__", "func_globals", "func_defaults", "func_code", "func_closure" };