Patchwork [8,of,9] osutil: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 12, 2015, 6:47 p.m.
Message ID <15481649cb4fd73326e7.1449946071@gps-mbp.local>
Download mbox | patch
Permalink /patch/11990/
State Superseded
Commit ac839ee45b6a5b178a380aa6d90aaa454dbb05b0
Delegated to: Yuya Nishihara
Headers show

Comments

Gregory Szorc - Dec. 12, 2015, 6:47 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1449945992 18000
#      Sat Dec 12 13:46:32 2015 -0500
# Node ID 15481649cb4fd73326e7223da49b9a8b30b56af6
# Parent  aa1cc2e14aa1425b261a706f4e1232ae852735cf
osutil: use absolute_import

Patch

diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py
--- a/mercurial/pure/osutil.py
+++ b/mercurial/pure/osutil.py
@@ -4,8 +4,10 @@ 
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
+from __future__ import absolute_import
+
 import os
 import stat as statmod
 
 def _mode_to_kind(mode):
@@ -57,9 +59,10 @@  def listdir(path, stat=False, skip=None)
 
 if os.name != 'nt':
     posixfile = open
 else:
-    import ctypes, msvcrt
+    import ctypes
+    import msvcrt
 
     _kernel32 = ctypes.windll.kernel32
 
     _DWORD = ctypes.c_ulong
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
@@ -121,9 +121,8 @@ 
   mercurial/mail.py requires print_function
   mercurial/manifest.py not using absolute_import
   mercurial/mdiff.py not using absolute_import
   mercurial/patch.py not using absolute_import
-  mercurial/pure/osutil.py not using absolute_import
   mercurial/pure/parsers.py not using absolute_import
   mercurial/pvec.py not using absolute_import
   mercurial/py3kcompat.py not using absolute_import
   mercurial/revlog.py not using absolute_import