# HG changeset patch # User timeless # Date 1456821766 0 # Node ID a73394e7b47cab3497692b0b976dc1d21a732173 # Parent 01815c15985618ba6f580f5e84410b0e5f984c22 zeroconf: use absolute_import diff -r 01815c159856 -r a73394e7b47c hgext/zeroconf/Zeroconf.py --- a/hgext/zeroconf/Zeroconf.py Tue Mar 01 07:17:32 2016 +0000 +++ b/hgext/zeroconf/Zeroconf.py Tue Mar 01 08:42:46 2016 +0000 @@ -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 @@ __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 @@ 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 @@ 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 -r 01815c159856 -r a73394e7b47c hgext/zeroconf/__init__.py --- a/hgext/zeroconf/__init__.py Tue Mar 01 07:17:32 2016 +0000 +++ b/hgext/zeroconf/__init__.py Tue Mar 01 08:42:46 2016 +0000 @@ -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 @@ $ 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 -r 01815c159856 -r a73394e7b47c tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t Tue Mar 01 07:17:32 2016 +0000 +++ b/tests/test-check-py3-compat.t Tue Mar 01 08:42:46 2016 +0000 @@ -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