[BUILD]use first appearance of import when check order (#9119)

This commit is contained in:
Tao Wang
2020-06-28 11:04:29 +08:00
committed by GitHub
parent 898e472425
commit a268277f38
+1 -1
View File
@@ -37,7 +37,7 @@ def check_import(file):
# - submodule import: `import ray.constants as ray_constants`
# - submodule import: `from ray import xyz`
if re.search(r"^\s*" + check + r"(\s*|\s+# noqa F401.*)$",
line):
line) and check_to_lines[check] == -1:
check_to_lines[check] = i
for import_lib in ["import psutil", "import setproctitle"]: