From c6a2be2d6816afb0884403b293bdfd067a1a3f32 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Fri, 25 Jan 2019 22:20:56 +0800 Subject: [PATCH] tools: make test.py Queue part Python 3 compatible Signed-off-by: gengjiawen PR-URL: https://github.com/nodejs/node/pull/25701 Reviewed-By: Anna Henningsen Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Refael Ackermann --- tools/test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 4a696d082a9f78..14ee454d473f86 100755 --- a/tools/test.py +++ b/tools/test.py @@ -47,7 +47,10 @@ from os.path import join, dirname, abspath, basename, isdir, exists from datetime import datetime -from Queue import Queue, Empty +try: + from queue import Queue, Empty # Python 3 +except ImportError: + from Queue import Queue, Empty # Python 2 try: cmp # Python 2