[PATCH 1 of 3] py3: conditionalize httplib import

Gregory Szorc gregory.szorc at gmail.com
Mon Jul 4 13:14:33 EDT 2016


On Mon, Jul 4, 2016 at 4:44 AM, Martijn Pieters <mj at zopatista.com> wrote:

> 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.


Keep in mind that flake8 wraps multiple linting packages. If we go with
flake8, we may need to customize it to only run the linting packages we
care about (possibly just pyflakes).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160704/90efbc63/attachment.html>


More information about the Mercurial-devel mailing list