[PATCH 1 of 3] py3: conditionalize httplib import

Martijn Pieters mj at zopatista.com
Mon Jul 4 07:44:41 EDT 2016


On 3 July 2016 at 11:54, Yuya Nishihara <yuya at tcha.org> wrote:
> On Fri, 1 Jul 2016 20:13:11 +0530, Pulkit Goyal wrote:
>> > if sys.version_info[0] < 3:
>> >     import httplib
>> > else:
>> >     import http.client as httplib
>>
>> Yeah we can have just one if else and fit all of them there. I will
>> send a patch related to this, if its okay.
>
> There seems no -1, let's do that. You might have to work around
> test-check-pyflakes.t, which would report unused imports.

Is there any chance we could switch to using flake8 here instead?
flake8 *uses* pyflakes but adds `# noqa: code, code` support to ignore
specific linting errors on specific lines. See
http://flake8.pycqa.org/en/latest/user/ignoring-errors.html.

Flake8 is also vastly more flexible and our check-code.py could
possibly be converted into a plugin for flake8.

-- 
Martijn Pieters


More information about the Mercurial-devel mailing list