D12284: check-code: allow importing Python 3 modules
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Wed Mar 2 23:30:12 UTC 2022
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D12284
AFFECTED FILES
contrib/check-code.py
CHANGE DETAILS
diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -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",
),
To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list