comparison contrib/check-code.py @ 48881:82f1c46cce5c

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 10:56:31 -0700
parents 6000f5b25c9b
children 55d132525155
comparison
equal deleted inserted replaced
48880:431084a68c4a 48881:82f1c46cce5c
427 (r'\butil\.Abort\b', "directly use error.Abort"), 427 (r'\butil\.Abort\b', "directly use error.Abort"),
428 ( 428 (
429 r'^@(\w*\.)?cachefunc', 429 r'^@(\w*\.)?cachefunc',
430 "module-level @cachefunc is risky, please avoid", 430 "module-level @cachefunc is risky, please avoid",
431 ), 431 ),
432 (
433 r'^import Queue',
434 "don't use Queue, use pycompat.queue.Queue + "
435 "pycompat.queue.Empty",
436 ),
437 (
438 r'^import cStringIO',
439 "don't use cStringIO.StringIO, use util.stringio",
440 ),
441 (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"),
442 (
443 r'^import SocketServer',
444 "don't use SockerServer, use util.socketserver",
445 ),
446 (r'^import urlparse', "don't use urlparse, use util.urlreq"),
447 (r'^import xmlrpclib', "don't use xmlrpclib, use util.xmlrpclib"),
448 (r'^import httplib', "don't use httplib, use util.httplib"),
449 (r'^import BaseHTTPServer', "use util.httpserver instead"),
450 ( 432 (
451 r'^(from|import) mercurial\.(cext|pure|cffi)', 433 r'^(from|import) mercurial\.(cext|pure|cffi)',
452 "use mercurial.policy.importmod instead", 434 "use mercurial.policy.importmod instead",
453 ), 435 ),
454 (r'\.next\(\)', "don't use .next(), use next(...)"), 436 (r'\.next\(\)', "don't use .next(), use next(...)"),