changeset 27507:a16489f9132d

keepalive: use absolute_import
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 22 Dec 2015 16:28:28 -0800
parents e6d3dad71e44
children b2226faead3f
files mercurial/keepalive.py tests/test-check-py3-compat.t
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/keepalive.py	Mon Dec 21 21:51:31 2015 -0800
+++ b/mercurial/keepalive.py	Tue Dec 22 16:28:28 2015 -0800
@@ -107,15 +107,17 @@
 
 # $Id: keepalive.py,v 1.14 2006/04/04 21:00:32 mstenner Exp $
 
+from __future__ import absolute_import
+
 import errno
 import httplib
 import socket
+import sys
 import thread
 import urllib2
 
 DEBUG = None
 
-import sys
 if sys.version_info < (2, 4):
     HANDLE_ERRORS = 1
 else: HANDLE_ERRORS = 0
@@ -616,7 +618,8 @@
     keepalive_handler.close_all()
 
 def continuity(url):
-    from util import md5
+    from . import util
+    md5 = util.md5
     format = '%25s: %s'
 
     # first fetch the file with the normal http handler
@@ -741,7 +744,6 @@
 
 if __name__ == '__main__':
     import time
-    import sys
     try:
         N = int(sys.argv[1])
         url = sys.argv[2]
--- a/tests/test-check-py3-compat.t	Mon Dec 21 21:51:31 2015 -0800
+++ b/tests/test-check-py3-compat.t	Tue Dec 22 16:28:28 2015 -0800
@@ -106,7 +106,6 @@
   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 not using absolute_import
   mercurial/keepalive.py requires print_function
   mercurial/localrepo.py not using absolute_import
   mercurial/lsprof.py requires print_function