[PATCH 4 of 5]fix_bytesmod: use absolute_import

Pulkit Goyal 7895pulkit at gmail.com
Fri Mar 11 14:45:49 UTC 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1457233549 -19800
#      Sun Mar 06 08:35:49 2016 +0530
# Node ID c741efc029cc80cfdee5b2fa8f449028b8a1f204
# Parent  373c63b0a98720fa9a05ead8df2f88535033941e
fix_bytesmod: use absolute_import

diff -r 373c63b0a987 -r c741efc029cc contrib/hgfixes/fix_bytesmod.py
--- a/contrib/hgfixes/fix_bytesmod.py    Sun Mar 06 08:32:24 2016 +0530
+++ b/contrib/hgfixes/fix_bytesmod.py    Sun Mar 06 08:35:49 2016 +0530
@@ -1,8 +1,17 @@
 """Fixer that changes bytes % whatever to a function that actually formats
 it."""

-from lib2to3 import fixer_base
-from lib2to3.fixer_util import is_tuple, Call, Comma, Name, touch_import
+from __future__ import absolute_import
+from lib2to3 import (
+fixer_base,
+)
+from lib2to3.fixer_util import (
+Call,
+Comma,
+is_tuple,
+Name,
+touch_import,
+)

 # XXX: Implementing a blacklist in 2to3 turned out to be more troublesome than
 # blacklisting some modules inside the fixers. So, this is what I came with.
diff -r 373c63b0a987 -r c741efc029cc tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t    Sun Mar 06 08:32:24 2016 +0530
+++ b/tests/test-check-py3-compat.t    Sun Mar 06 08:35:49 2016 +0530
@@ -3,7 +3,6 @@
   $ cd "$TESTDIR"/..

   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python
contrib/check-py3-compat.py
-  contrib/hgfixes/fix_bytesmod.py not using absolute_import
   contrib/hgfixes/fix_leftover_imports.py not using absolute_import
   contrib/import-checker.py not using absolute_import
   contrib/import-checker.py requires print_function


More information about the Mercurial-devel mailing list