Patchwork [2,of,5] httpconnection: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 23, 2015, 8:46 p.m.
Message ID <9784529187b73667791c.1450903604@7.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/12315/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Gregory Szorc - Dec. 23, 2015, 8:46 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1450763578 28800
#      Mon Dec 21 21:52:58 2015 -0800
# Node ID 9784529187b73667791ca5c0f911c6460acd3b4d
# Parent  fa41eef558351442bb828ef8b573f3b450bd05c5
httpconnection: use absolute_import

Patch

diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py
--- a/mercurial/httpconnection.py
+++ b/mercurial/httpconnection.py
@@ -6,18 +6,23 @@ 
 # Copyright 2011 Google, Inc.
 #
 # 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 logging
+import os
 import socket
 import urllib
 import urllib2
-import os
 
-from mercurial import httpclient
-from mercurial import sslutil
-from mercurial import util
-from mercurial.i18n import _
+from .i18n import _
+from . import (
+    httpclient,
+    sslutil,
+    util,
+)
 
 # moved here from url.py to avoid a cycle
 class httpsendfile(object):
     """This is a wrapper around the objects returned by python's "open".
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
@@ -104,9 +104,8 @@ 
   mercurial/exchange.py not using absolute_import
   mercurial/httpclient/__init__.py not using absolute_import
   mercurial/httpclient/_readers.py not using absolute_import
   mercurial/httpclient/socketutil.py not using absolute_import
-  mercurial/httpconnection.py not using absolute_import
   mercurial/keepalive.py requires print_function
   mercurial/localrepo.py not using absolute_import
   mercurial/lsprof.py requires print_function
   mercurial/lsprofcalltree.py requires print_function