[PATCH 4 of 7] hgext: make color use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Sat Apr 16 17:33:10 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1460834636 -19800
#      Sun Apr 17 00:53:56 2016 +0530
# Node ID 1d01f944908f27a35f8f246a3214ae4f261db94b
# Parent  fc114737ef500f6a29f239101ea6f8de945ec446
hgext: make color use absolute_import

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -153,10 +153,18 @@
 If ``pagermode`` is not defined, the ``mode`` will be used.
 '''
 
+from __future__ import absolute_import
+
 import os
-
-from mercurial import cmdutil, commands, dispatch, extensions, subrepo, util
-from mercurial import ui as uimod
+from mercurial import (
+    cmdutil,
+    commands,
+    dispatch,
+    extensions,
+    subrepo,
+    ui as uimod,
+    util,
+)
 from mercurial.i18n import _
 
 cmdtable = {}
@@ -523,7 +531,8 @@
 if os.name != 'nt':
     w32effects = None
 else:
-    import re, ctypes
+    import ctypes
+    import re
 
     _kernel32 = ctypes.windll.kernel32
 
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
@@ -3,7 +3,6 @@
   $ cd "$TESTDIR"/..
 
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
-  hgext/color.py not using absolute_import
   hgext/eol.py not using absolute_import
   hgext/extdiff.py not using absolute_import
   hgext/factotum.py not using absolute_import


More information about the Mercurial-devel mailing list