Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions www/src/Lib/importlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -138,7 +138,7 @@ def _module_to_load(name):
except KeyError:
pass
finally:
module.__initializing__ = False
module.__initialized__ = True


def set_package(fxn):
Expand Down
1 change: 0 additions & 1 deletion www/src/Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__',
Expand Down
4 changes: 2 additions & 2 deletions www/src/Lib/test/test_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions www/src/py_import.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__")
Expand Down