[PATCH] D68779: [LNT][NFC] Fix global import in function
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 06:53:21 PST 2019
thopre marked an inline comment as done.
thopre added inline comments.
================
Comment at: lnt/lnttool/admin.py:8-13
+ yaml = __import__('yaml', globals(), locals())
+ sys = __import__('sys', globals(), locals())
+ requests = __import__('requests', globals(), locals())
+ json = __import__('json', globals(), locals())
+ os = __import__('os', globals(), locals())
+ httplib = __import__('httplib', globals(), locals())
----------------
PrzemekWirkus wrote:
> PrzemekWirkus wrote:
> > Thomas,
> > why are you not using importlib.import_module instead of __import__ ?
> > Any other reason except for the Python 2 backward compatibility ?
> s/import/__import__/
The version available in Python 2.7 does not seem to return a value, how to bind the loaded modules to the global variables then?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68779/new/
https://reviews.llvm.org/D68779
More information about the llvm-commits
mailing list