diff --git a/www/src/Lib/importlib/util.py b/www/src/Lib/importlib/util.py index 8623c8984..d98fa9448 100644 --- a/www/src/Lib/importlib/util.py +++ b/www/src/Lib/importlib/util.py @@ -127,7 +127,7 @@ def _module_to_load(name): module = type(sys)(name) # This must be done before putting the module in sys.modules # (otherwise an optimization shortcut in import.c becomes wrong) - module.__initializing__ = True + module.__initialized__ = False sys.modules[name] = module try: yield module @@ -138,7 +138,7 @@ def _module_to_load(name): except KeyError: pass finally: - module.__initializing__ = False + module.__initialized__ = True def set_package(fxn): diff --git a/www/src/Lib/pydoc.py b/www/src/Lib/pydoc.py index 84e673a7f..e24667cf8 100644 --- a/www/src/Lib/pydoc.py +++ b/www/src/Lib/pydoc.py @@ -276,7 +276,6 @@ def _split_list(s, predicate): def visiblename(name, all=None, obj=None): """Decide whether to show documentation on a variable.""" # Certain special names are redundant or internal. - # XXX Remove __initializing__? if name in {'__author__', '__builtins__', '__cached__', '__credits__', '__date__', '__doc__', '__file__', '__spec__', '__loader__', '__module__', '__name__', '__package__', diff --git a/www/src/Lib/test/test_pkg.py b/www/src/Lib/test/test_pkg.py index eed0fd1c6..004cda19e 100644 --- a/www/src/Lib/test/test_pkg.py +++ b/www/src/Lib/test/test_pkg.py @@ -22,8 +22,8 @@ def cleanout(root): def fixdir(lst): if "__builtins__" in lst: lst.remove("__builtins__") - if "__initializing__" in lst: - lst.remove("__initializing__") + if "__initialized__" in lst: + lst.remove("__initialized__") return lst diff --git a/www/src/py_import.js b/www/src/py_import.js index a1cc58047..a2e141fbf 100644 --- a/www/src/py_import.js +++ b/www/src/py_import.js @@ -332,7 +332,7 @@ function run_py(module_contents, path, module, compiled) { for(let attr in mod){ module[attr] = mod[attr] } - module.__initializing__ = false + module.__initialized__ = true // $B.imported[mod.__name__] must be the module object, so that // setting attributes in a program affects the module namespace // See issue #7 @@ -1093,7 +1093,7 @@ $B.$__import__ = function(mod_name, globals, locals, fromlist){ _b_.setattr($B.imported[_parent_name], parsed_name[i], $B.imported[_mod_name]) } - // [Import spec] If __path__ can not be accessed an ImportError is raised + // [Import spec] Module check if(i < len){ try{ __path__ = $B.$getattr($B.imported[_mod_name], "__path__")