diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-03-13 18:37:25 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-03-17 10:12:36 -0400 |
| commit | 64ccf4d02a497f0e584c544f5e5fb55d5cbf8c30 (patch) | |
| tree | 96d64d0e38c2bc88475eea01796ec22246d2cbdd /lib/sqlalchemy | |
| parent | fcc03730c553b3fc0229e446e886d4f61dcb6291 (diff) | |
| download | sqlalchemy-64ccf4d02a497f0e584c544f5e5fb55d5cbf8c30.tar.gz | |
import the module as passed before we look in sys.modules
in I2e291eba4297867fc0ddb5d875b9f7af34751d01, the importer
is importing tokens[0:-1] and then the final token as the name;
this doesn't always work for the two example modules of "xml.dom"
and "wsgiref.simple_server". import the complete path we will
pull from sys.modules directly.
Change-Id: I833a770f4c3e7463fa56234d891870083e48cc73
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index bac95c7e3..474463981 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -1026,10 +1026,7 @@ class _ModuleRegistry: for module in self.module_registry: key = module.split("sqlalchemy.")[-1].replace(".", "_") if module.startswith(path) and key not in self.__dict__: - tokens = module.split(".") - compat.import_( - ".".join(tokens[0:-1]), globals(), locals(), [tokens[-1]] - ) + compat.import_(module, globals(), locals()) self.__dict__[key] = sys.modules[module] |
