From 16cf2c6c20a57041151ccfa76a1b9494672a910a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 17 Oct 2013 17:17:22 -0400 Subject: parallel: support python-3 with the queue module This doesn't really impact us today, but I'm trying to use this module in other projects, and those want python-3 compatibility. BUG=None TEST=`./parallel_unittest.py` Change-Id: If951831a57d3a6b64acaf42f1006cfff313126ef Reviewed-on: https://chromium-review.googlesource.com/173610 Reviewed-by: David James Tested-by: Mike Frysinger --- lib/parallel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/parallel.py') diff --git a/lib/parallel.py b/lib/parallel.py index 5ec7a1af6..ed13df4fd 100644 --- a/lib/parallel.py +++ b/lib/parallel.py @@ -11,7 +11,13 @@ import functools import logging import multiprocessing import os -import Queue +try: + import Queue +except ImportError: + # Python-3 renamed to "queue". We still use Queue to avoid collisions + # with naming variables as "queue". Maybe we'll transition at some point. + # pylint: disable=F0401 + import queue as Queue import signal import sys import tempfile -- cgit v1.2.3