[Pkg-privacy-commits] [txtorcon] 37/49: remove serverFromString py3 hacks
Ximin Luo
infinity0 at debian.org
Mon Oct 19 13:49:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository txtorcon.
commit 7b1dc49be7881e6a9f4f73369325dc8c0eefb2aa
Author: meejah <meejah at meejah.ca>
Date: Tue Sep 8 11:09:44 2015 -0600
remove serverFromString py3 hacks
---
txtorcon/util.py | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/txtorcon/util.py b/txtorcon/util.py
index ace0391..ec6db53 100644
--- a/txtorcon/util.py
+++ b/txtorcon/util.py
@@ -16,12 +16,7 @@ import struct
from twisted.internet import defer
from twisted.internet.interfaces import IProtocolFactory
-# FIXME: Remove this try/except block when t.i.e.serverFromString is available
-# in py3k. See also the related hack in :func:`available_tcp_port`.
-try:
- from twisted.internet.endpoints import serverFromString
-except ImportError:
- serverFromString = None
+from twisted.internet.endpoints import serverFromString
from zope.interface import implementer
@@ -289,13 +284,7 @@ def available_tcp_port(reactor):
assigned port number.
"""
- # FIXME: Remove this if/else block when t.i.e.serverFromString is
- # available in py3k.
- if serverFromString:
- endpoint = serverFromString(reactor, 'tcp:0:interface=127.0.0.1')
- else:
- endpoint = TCP4ServerEndpoint(reactor, 0, backlog=50, interface='127.0.0.1')
-
+ endpoint = serverFromString(reactor, 'tcp:0:interface=127.0.0.1')
port = yield endpoint.listen(NoOpProtocolFactory())
address = port.getHost()
yield port.stopListening()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/txtorcon.git
More information about the Pkg-privacy-commits
mailing list