[Lldb-commits] [lldb] r252127 - Python 3 - Don't use `os.path.walk`, it's removed in Py3.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 4 17:33:54 PST 2015


Author: zturner
Date: Wed Nov  4 19:33:54 2015
New Revision: 252127

URL: http://llvm.org/viewvc/llvm-project?rev=252127&view=rev
Log:
Python 3 - Don't use `os.path.walk`, it's removed in Py3.

It was deprecated even in 2.7, but not removed until 3.x.  os.walk
provides all of the same functionality and is the correct way to
do this now.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=252127&r1=252126&r2=252127&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Nov  4 19:33:54 2015
@@ -1230,9 +1230,6 @@ def visit(prefix, dir, names):
         return
 
     for name in names:
-        if os.path.isdir(os.path.join(dir, name)):
-            continue
-
         if '.py' == os.path.splitext(name)[1] and name.startswith(prefix):
 
             if name in all_tests:
@@ -1555,7 +1552,8 @@ def run_suite():
     # Walk through the testdirs while collecting tests.
     #
     for testdir in testdirs:
-        os.path.walk(testdir, visit, 'Test')
+        for (dirpath, dirnames, filenames) in os.walk(testdir):
+            visit('Test', dirpath, filenames)
 
     #
     # Now that we have loaded all the test cases, run the whole test suite.




More information about the lldb-commits mailing list