Patchwork [6,of,7] windows: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 13, 2015, 7:34 a.m.
Message ID <2d07da2009b3176818e6.1449992056@7.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/12009/
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 1449991178 28800
#      Sat Dec 12 23:19:38 2015 -0800
# Node ID 2d07da2009b3176818e6ee2678fbe0f50fbd9e7b
# Parent  0ea6e811746c2833d8413cae13404e6e4dde1b8c
windows: use absolute_import

Patch

diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -4,13 +4,25 @@ 
 #
 # 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 osutil, encoding
-import errno, msvcrt, os, re, stat, sys, _winreg
+from __future__ import absolute_import
 
+import _winreg
+import errno
+import msvcrt
+import os
+import re
+import stat
+import sys
 import win32
+
+from .i18n import _
+from . import (
+    encoding,
+    osutil,
+)
+
 executablepath = win32.executablepath
 getuser = win32.getuser
 hidewindow = win32.hidewindow
 makedir = win32.makedir
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
@@ -127,9 +127,8 @@ 
   mercurial/scmposix.py not using absolute_import
   mercurial/scmutil.py not using absolute_import
   mercurial/scmwindows.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
   tests/generate-working-copy-states.py requires print_function
   tests/get-with-headers.py requires print_function