Show More
@@ -384,11 +384,23 b' class StrongRef:' | |||||
384 | return self.obj |
|
384 | return self.obj | |
385 |
|
385 | |||
386 |
|
386 | |||
|
387 | mod_attrs = [ | |||
|
388 | "__name__", | |||
|
389 | "__doc__", | |||
|
390 | "__package__", | |||
|
391 | "__loader__", | |||
|
392 | "__spec__", | |||
|
393 | "__file__", | |||
|
394 | "__cached__", | |||
|
395 | "__builtins__" | |||
|
396 | ] | |||
|
397 | ||||
|
398 | ||||
387 | def append_obj(module, d, name, obj, autoload=False): |
|
399 | def append_obj(module, d, name, obj, autoload=False): | |
388 | not_in_mod = not hasattr(obj, "__module__") or obj.__module__ != module.__name__ |
|
400 | not_in_mod = not hasattr(obj, "__module__") or obj.__module__ != module.__name__ | |
389 | if autoload: |
|
401 | if autoload: | |
390 |
# check needed for module global built-ins |
|
402 | # check needed for module global built-ins | |
391 | if name.startswith("__") and not_in_mod: |
|
403 | if not_in_mod and name in mod_attrs: | |
392 | return False |
|
404 | return False | |
393 | else: |
|
405 | else: | |
394 | if not_in_mod: |
|
406 | if not_in_mod: |
General Comments 0
You need to be logged in to leave comments.
Login now