[PATCH 3 of 8] py3: make hgext/gpg.py use absolute_import

Yuya Nishihara yuya at tcha.org
Mon May 9 18:48:34 EDT 2016


On Mon, 9 May 2016 16:00:35 +0200, Pierre-Yves David wrote:
> On 05/09/2016 03:24 PM, Yuya Nishihara wrote:
> > On Fri, 06 May 2016 11:52:28 -0500, Pulkit Goyal wrote:  
> >> # HG changeset patch
> >> # User Pulkit Goyal <7895pulkit at gmail.com>
> >> # Date 1462551377 -19800
> >> #      Fri May 06 21:46:17 2016 +0530
> >> # Node ID fb259cfefb41fc09c9d56bbcc3839eac59c25eb7
> >> # Parent  0f5c3028f447377c6e3138408c03180bb49141ae
> >> py3: make hgext/gpg.py use absolute_import
> >>
> >> diff --git a/hgext/gpg.py b/hgext/gpg.py
> >> --- a/hgext/gpg.py
> >> +++ b/hgext/gpg.py
> >> @@ -5,9 +5,19 @@
> >>   
> >>   '''commands to sign and verify changesets'''
> >>   
> >> -import os, tempfile, binascii
> >> -from mercurial import util, commands, match, cmdutil, error
> >> -from mercurial import node as hgnode
> >> +from __future__ import absolute_import
> >> +
> >> +import binascii
> >> +import os
> >> +import tempfile
> >> +from mercurial import (
> >> +    cmdutil,
> >> +    commands,
> >> +    error,
> >> +    match,
> >> +    node as hgnode,
> >> +    util,
> >> +)
> >>   from mercurial.i18n import _  
> > Looks like this is "symbol import follows non-symbol import" case, though
> > it wasn't reported by import-checker.  
> 
> I'm not sure, node is a module here. I've taken the series as is and we 
> can fix the import checker and follow up if something was wrong.

I meant "from mercurial import" should follow "from mercurial.i18n import _".
But that's just a conventional style, I don't care much.


More information about the Mercurial-devel mailing list