[PATCH] D68779: [LNT][NFC] Fix global import in function

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 12:07:53 PST 2019


thopre updated this revision to Diff 232427.
thopre added a comment.

Remove Python 3 requirement since LNT is not Python 3 compatible at this stage


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68779/new/

https://reviews.llvm.org/D68779

Files:
  lnt/lnttool/admin.py


Index: lnt/lnttool/admin.py
===================================================================
--- lnt/lnttool/admin.py
+++ lnt/lnttool/admin.py
@@ -1,16 +1,17 @@
 #!/usr/bin/env python
 import click
+from importlib import import_module
 from .common import submit_options
 
 
 def _load_dependencies():
     global yaml, sys, requests, json, os, httplib
-    import yaml
-    import sys
-    import requests
-    import json
-    import os
-    import httplib
+    yaml = import_module('yaml')
+    sys = import_module('sys')
+    requests = import_module('requests')
+    json = import_module('json')
+    os = import_module('os')
+    httplib = import_module('httplib')
 
 
 def _error(msg):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68779.232427.patch
Type: text/x-patch
Size: 696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191205/70a44cd6/attachment.bin>


More information about the llvm-commits mailing list