Patchwork [5,of,7] similar: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 13, 2015, 7:34 a.m.
Message ID <0ea6e811746c2833d841.1449992055@7.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/12008/
State Accepted
Headers show

Comments

Gregory Szorc - Dec. 13, 2015, 7:34 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1449991042 28800
#      Sat Dec 12 23:17:22 2015 -0800
# Node ID 0ea6e811746c2833d8413cae13404e6e4dde1b8c
# Parent  61c3572b5a00aa40f542206cd3e12175b3bbc71d
similar: use absolute_import

Patch

diff --git a/mercurial/similar.py b/mercurial/similar.py
--- a/mercurial/similar.py
+++ b/mercurial/similar.py
@@ -4,12 +4,16 @@ 
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from i18n import _
-import util
-import mdiff
-import bdiff
+from __future__ import absolute_import
+
+from .i18n import _
+from . import (
+    bdiff,
+    mdiff,
+    util,
+)
 
 def _findexactmatches(repo, added, removed):
     '''find renamed files that have no changes
 
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -126,9 +126,8 @@ 
   mercurial/revlog.py not using absolute_import
   mercurial/scmposix.py not using absolute_import
   mercurial/scmutil.py not using absolute_import
   mercurial/scmwindows.py not using absolute_import
-  mercurial/similar.py not using absolute_import
   mercurial/store.py not using absolute_import
   mercurial/windows.py not using absolute_import
   setup.py not using absolute_import
   tests/filterpyflakes.py requires print_function