]> granicus.if.org Git - clang/commitdiff
Portable Python script across Python version
authorSerge Guelton <sguelton@quarkslab.com>
Thu, 13 Dec 2018 07:44:19 +0000 (07:44 +0000)
committerSerge Guelton <sguelton@quarkslab.com>
Thu, 13 Dec 2018 07:44:19 +0000 (07:44 +0000)
Queue module as been renamed into queue in Python3

Differential Revision: https://reviews.llvm.org/D55202

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349009 91177308-0d34-0410-b5e6-96231b3b80d8

utils/analyzer/SATestBuild.py

index 95dd69d6beb1e8eb82e0c7afa23690da6d79bb1a..ef0ab195f1ab5b51704032da144887a46d2bf28f 100755 (executable)
@@ -58,7 +58,10 @@ import shutil
 import sys
 import threading
 import time
-import Queue
+try:
+    import queue
+except ImportError:
+    import Queue as queue
 
 ###############################################################################
 # Helper functions.
@@ -742,7 +745,7 @@ def multiThreadedTestAll(Args, ProjectsToTest, Jobs):
 
     :return: whether tests have passed.
     """
-    TasksQueue = Queue.Queue()
+    TasksQueue = queue.Queue()
 
     for ProjArgs in ProjectsToTest:
         TasksQueue.put(ProjArgs)