[PATCH] D38542: [test] Fix append_path in the empty case

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 09:39:13 PDT 2017


fjricci updated this revision to Diff 117685.
fjricci retitled this revision from "[test] Fix ASAN_OPTIONS to prevent adding trailing colon" to "[test] Fix append_path in the empty case".
fjricci edited the summary of this revision.
fjricci added a comment.

fix append_path


https://reviews.llvm.org/D38542

Files:
  utils/lit/lit/llvm/config.py


Index: utils/lit/lit/llvm/config.py
===================================================================
--- utils/lit/lit/llvm/config.py
+++ utils/lit/lit/llvm/config.py
@@ -107,9 +107,13 @@
             def norm(x):
                 return os.path.normcase(os.path.normpath(x))
 
-            current_paths = self.config.environment.get(variable, "")
-            current_paths = current_paths.split(os.path.pathsep)
-            paths = [norm(p) for p in current_paths]
+            current_paths = self.config.environment.get(variable, None)
+            if current_paths:
+                current_paths = current_paths.split(os.path.pathsep)
+                paths = [norm(p) for p in current_paths]
+            else:
+                paths = []
+
             # If we are passed a list [a b c], then iterating this list forwards
             # and adding each to the beginning would result in b c a.  So we
             # need to iterate in reverse to end up with the original ordering.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38542.117685.patch
Type: text/x-patch
Size: 993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171004/4ce50cd8/attachment.bin>


More information about the llvm-commits mailing list