aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packaging-tools/threadedwork.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/packaging-tools/threadedwork.py b/packaging-tools/threadedwork.py
index fd52a82db..b47d66fc9 100644
--- a/packaging-tools/threadedwork.py
+++ b/packaging-tools/threadedwork.py
@@ -50,9 +50,17 @@ import os
import threading
import traceback
import time
-import Queue as queue # The Queue module has been renamed to queue in Python 3.
import sys
-import __builtin__
+
+try:
+ import queue #python2
+except ImportError:
+ import Queue as queue #python3
+
+try:
+ import __builtin__ #python2
+except ImportError:
+ import builtins as __builtin__#python3
# we are using RLock, because threadedPrint is using the same lock
outputLock = threading.RLock()