diff --git a/hgext/zeroconf/Zeroconf.py b/hgext/zeroconf/Zeroconf.py --- a/hgext/zeroconf/Zeroconf.py +++ b/hgext/zeroconf/Zeroconf.py @@ -1,4 +1,4 @@ -from __future__ import print_function +from __future__ import absolute_import, print_function """ Multicast DNS Service Discovery for Python, v0.12 Copyright (C) 2003, Paul Scott-Murphy @@ -80,12 +80,12 @@ from __future__ import print_function __email__ = "paul at scott dash murphy dot com" __version__ = "0.12" +import select +import socket import string -import time import struct -import socket import threading -import select +import time import traceback __all__ = ["Zeroconf", "ServiceInfo", "ServiceBrowser"] @@ -763,8 +763,8 @@ class DNSOutgoing(object): self.finished = 1 for question in self.questions: self.writeQuestion(question) - for answer, time in self.answers: - self.writeRecord(answer, time) + for answer, time_ in self.answers: + self.writeRecord(answer, time_) for authority in self.authorities: self.writeRecord(authority, 0) for additional in self.additionals: @@ -868,9 +868,9 @@ class Engine(threading.Thread): else: try: rr, wr, er = select.select(rs, [], [], self.timeout) - for socket in rr: + for sock in rr: try: - self.readers[socket].handle_read() + self.readers[sock].handle_read() except Exception: if not globals()['_GLOBAL_DONE']: traceback.print_exc() diff --git a/hgext/zeroconf/__init__.py b/hgext/zeroconf/__init__.py --- a/hgext/zeroconf/__init__.py +++ b/hgext/zeroconf/__init__.py @@ -4,7 +4,6 @@ # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. - '''discover and advertise repositories on the local network Zeroconf-enabled repositories will be announced in a network without @@ -23,13 +22,23 @@ You can discover Zeroconf-enabled reposi $ hg paths zc-test = http://example.com:8000/test ''' +from __future__ import absolute_import -import socket, time, os +import os +import socket +import time -import Zeroconf -from mercurial import ui, hg, encoding, dispatch -from mercurial import extensions -from mercurial.hgweb import server as servermod +from . import Zeroconf +from mercurial import ( + dispatch, + encoding, + extensions, + hg, + ui, +) +from mercurial.hgweb import ( + server as servermod +) # Note for extension authors: ONLY specify testedwith = 'internal' for # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should 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 @@ -86,8 +86,6 @@ hgext/transplant.py not using absolute_import hgext/win32mbcs.py not using absolute_import hgext/win32text.py not using absolute_import - hgext/zeroconf/Zeroconf.py not using absolute_import - hgext/zeroconf/__init__.py not using absolute_import i18n/check-translation.py not using absolute_import i18n/polib.py not using absolute_import mercurial/cmdutil.py not using absolute_import