package_base.py: use sys.modules for module lookup (#50230)
This commit is contained in:
parent
ecc3752ee9
commit
a6b0dfbd53
@ -14,7 +14,6 @@
|
|||||||
import functools
|
import functools
|
||||||
import glob
|
import glob
|
||||||
import hashlib
|
import hashlib
|
||||||
import importlib
|
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@ -818,12 +817,12 @@ def package_dir(cls):
|
|||||||
|
|
||||||
@classproperty
|
@classproperty
|
||||||
def module(cls):
|
def module(cls):
|
||||||
"""Module object (not just the name) that this package is defined in.
|
"""Module instance that this package class is defined in.
|
||||||
|
|
||||||
We use this to add variables to package modules. This makes
|
We use this to add variables to package modules. This makes
|
||||||
install() methods easier to write (e.g., can call configure())
|
install() methods easier to write (e.g., can call configure())
|
||||||
"""
|
"""
|
||||||
return importlib.import_module(cls.__module__)
|
return sys.modules[cls.__module__]
|
||||||
|
|
||||||
@classproperty
|
@classproperty
|
||||||
def namespace(cls):
|
def namespace(cls):
|
||||||
|
Loading…
Reference in New Issue
Block a user