Skip to content

Commit c6a2be2

Browse files
gengjiawenMylesBorins
authored andcommitted
tools: make test.py Queue part Python 3 compatible
Signed-off-by: gengjiawen <[email protected]> PR-URL: #25701 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 1afd614 commit c6a2be2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747

4848
from os.path import join, dirname, abspath, basename, isdir, exists
4949
from datetime import datetime
50-
from Queue import Queue, Empty
50+
try:
51+
from queue import Queue, Empty # Python 3
52+
except ImportError:
53+
from Queue import Queue, Empty # Python 2
5154

5255
try:
5356
cmp # Python 2

0 commit comments

Comments
 (0)