From c31a2ec933768d773e5312532e35b57d0570e580 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 16 Oct 2019 21:27:56 +0200 Subject: make threadedwork python 3 ready Change-Id: I450180b029ac47541f5da95e9740cc55a37e7aa5 Reviewed-by: Tim Jenssen --- packaging-tools/threadedwork.py | 12 ++++++++++-- 1 file 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() -- cgit v1.2.3