# HG changeset patch # User Gregory Szorc # Date 2015-12-23 00:28:28 # Node ID a16489f9132d39f1744f0a15d8edeba8a4cd521c # Parent e6d3dad71e44452afd97ae558c1c1f02828192ca keepalive: use absolute_import diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py --- a/mercurial/keepalive.py +++ b/mercurial/keepalive.py @@ -107,15 +107,17 @@ EXTRA ATTRIBUTES AND METHODS # $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 @@ def error_handler(url): 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 @@ def test(url, N=10): if __name__ == '__main__': import time - import sys try: N = int(sys.argv[1]) url = sys.argv[2] 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 @@ -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