check-code: allow importing Python 3 modules
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 21 Feb 2022 10:56:31 -0700
changeset 48881 82f1c46cce5c
parent 48880 431084a68c4a
child 48882 640e1cb6a7de
check-code: allow importing Python 3 modules Now that we no longer support Python 2, we should be able to import and use the Python 3 only modules in our code. So remove a lint banning this. Differential Revision: https://phab.mercurial-scm.org/D12284
contrib/check-code.py
--- a/contrib/check-code.py	Wed Mar 02 08:29:52 2022 -0700
+++ b/contrib/check-code.py	Mon Feb 21 10:56:31 2022 -0700
@@ -430,24 +430,6 @@
             "module-level @cachefunc is risky, please avoid",
         ),
         (
-            r'^import Queue',
-            "don't use Queue, use pycompat.queue.Queue + "
-            "pycompat.queue.Empty",
-        ),
-        (
-            r'^import cStringIO',
-            "don't use cStringIO.StringIO, use util.stringio",
-        ),
-        (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"),
-        (
-            r'^import SocketServer',
-            "don't use SockerServer, use util.socketserver",
-        ),
-        (r'^import urlparse', "don't use urlparse, use util.urlreq"),
-        (r'^import xmlrpclib', "don't use xmlrpclib, use util.xmlrpclib"),
-        (r'^import httplib', "don't use httplib, use util.httplib"),
-        (r'^import BaseHTTPServer', "use util.httpserver instead"),
-        (
             r'^(from|import) mercurial\.(cext|pure|cffi)',
             "use mercurial.policy.importmod instead",
         ),