comparison contrib/check-code.py @ 29566:075146e85bb6

py3: conditionalize BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer import The BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer has been merged into http.server in python 3. All of them has been merged as util.httpserver to use in both python 2 and 3. This patch adds a regex to check-code to warn against the use of BaseHTTPServer. Moreover this patch also includes updates to lower part of test-check-py3-compat.t which used to remain unchanged.
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 13 Jul 2016 23:38:29 +0530
parents 57106f357cd1
children 7825f6154a65
comparison
equal deleted inserted replaced
29565:143d21a7343e 29566:075146e85bb6
331 (r'^import urlparse', "don't use urlparse, use util.urlparse"), 331 (r'^import urlparse', "don't use urlparse, use util.urlparse"),
332 (r'^import xmlrpclib', "don't use xmlrpclib, use util.xmlrpclib"), 332 (r'^import xmlrpclib', "don't use xmlrpclib, use util.xmlrpclib"),
333 (r'^import cPickle', "don't use cPickle, use util.pickle"), 333 (r'^import cPickle', "don't use cPickle, use util.pickle"),
334 (r'^import pickle', "don't use pickle, use util.pickle"), 334 (r'^import pickle', "don't use pickle, use util.pickle"),
335 (r'^import httplib', "don't use httplib, use util.httplib"), 335 (r'^import httplib', "don't use httplib, use util.httplib"),
336 (r'^import BaseHTTPServer', "use util.httpserver instead"),
336 (r'\.next\(\)', "don't use .next(), use next(...)"), 337 (r'\.next\(\)', "don't use .next(), use next(...)"),
337 338
338 # rules depending on implementation of repquote() 339 # rules depending on implementation of repquote()
339 (r' x+[xpqo%APM][\'"]\n\s+[\'"]x', 340 (r' x+[xpqo%APM][\'"]\n\s+[\'"]x',
340 'string join across lines with no space'), 341 'string join across lines with no space'),