Mercurial > hg
comparison tests/run-tests.py @ 48867:f547a5dee234
tests: unconditionalize some imports
Now that we require Python 3 we can simplify these imports.
Differential Revision: https://phab.mercurial-scm.org/D12245
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Feb 2022 13:29:47 -0700 |
parents | 2ccd5e71bcd3 |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
48866:2ccd5e71bcd3 | 48867:f547a5dee234 |
---|---|
55 import functools | 55 import functools |
56 import json | 56 import json |
57 import multiprocessing | 57 import multiprocessing |
58 import os | 58 import os |
59 import platform | 59 import platform |
60 import queue | |
60 import random | 61 import random |
61 import re | 62 import re |
63 import shlex | |
62 import shutil | 64 import shutil |
63 import signal | 65 import signal |
64 import socket | 66 import socket |
65 import subprocess | 67 import subprocess |
66 import sys | 68 import sys |
71 import unittest | 73 import unittest |
72 import uuid | 74 import uuid |
73 import xml.dom.minidom as minidom | 75 import xml.dom.minidom as minidom |
74 | 76 |
75 WINDOWS = os.name == r'nt' | 77 WINDOWS = os.name == r'nt' |
76 | 78 shellquote = shlex.quote |
77 try: | |
78 import Queue as queue | |
79 except ImportError: | |
80 import queue | |
81 | |
82 try: | |
83 import shlex | |
84 | |
85 shellquote = shlex.quote | |
86 except (ImportError, AttributeError): | |
87 import pipes | |
88 | |
89 shellquote = pipes.quote | |
90 | 79 |
91 | 80 |
92 processlock = threading.Lock() | 81 processlock = threading.Lock() |
93 | 82 |
94 pygmentspresent = False | 83 pygmentspresent = False |