changeset 27486:5bfd01a3c2a9

py3compat: use absolute_import
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Dec 2015 21:31:57 -0800
parents 60183975b5bc
children 4242d699de6d
files mercurial/py3kcompat.py tests/test-check-py3-compat.t
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/py3kcompat.py	Mon Dec 21 21:33:52 2015 -0800
+++ b/mercurial/py3kcompat.py	Mon Dec 21 21:31:57 2015 -0800
@@ -5,9 +5,12 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-import builtins
+from __future__ import absolute_import
 
-from numbers import Number
+import builtins
+import numbers
+
+Number = numbers.Number
 
 def bytesformatter(format, args):
     '''Custom implementation of a formatter for bytestrings.
--- a/tests/test-check-py3-compat.t	Mon Dec 21 21:33:52 2015 -0800
+++ b/tests/test-check-py3-compat.t	Mon Dec 21 21:31:57 2015 -0800
@@ -118,7 +118,6 @@
   mercurial/mail.py requires print_function
   mercurial/manifest.py not using absolute_import
   mercurial/pvec.py not using absolute_import
-  mercurial/py3kcompat.py not using absolute_import
   setup.py not using absolute_import
   tests/filterpyflakes.py requires print_function
   tests/generate-working-copy-states.py requires print_function