launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #23083
[Merge] ~cjwatson/turnip:xmlrpc-py3 into turnip:master
Colin Watson has proposed merging ~cjwatson/turnip:xmlrpc-py3 into turnip:master.
Commit message:
Import twisted.web.xmlrpc on Python 3 too
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/turnip/+git/turnip/+merge/359014
It was ported in Twisted 15.3.0.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/turnip:xmlrpc-py3 into turnip:master.
diff --git a/turnip/pack/git.py b/turnip/pack/git.py
index 79c6194..88d5ffe 100644
--- a/turnip/pack/git.py
+++ b/turnip/pack/git.py
@@ -7,7 +7,6 @@ from __future__ import (
unicode_literals,
)
-import sys
import uuid
from twisted.internet import (
@@ -18,10 +17,7 @@ from twisted.internet import (
)
from twisted.internet.interfaces import IHalfCloseableProtocol
from twisted.logger import Logger
-# twisted.web.xmlrpc doesn't exist for Python 3 yet, but the non-XML-RPC
-# bits of this module work.
-if sys.version_info.major < 3: # noqa
- from twisted.web import xmlrpc
+from twisted.web import xmlrpc
from zope.interface import implementer
from turnip.helpers import compose_path
diff --git a/turnip/pack/hookrpc.py b/turnip/pack/hookrpc.py
index a94eddf..7d818bf 100644
--- a/turnip/pack/hookrpc.py
+++ b/turnip/pack/hookrpc.py
@@ -21,17 +21,13 @@ from __future__ import (
)
import json
-import sys
from twisted.internet import (
defer,
protocol,
)
from twisted.protocols import basic
-# twisted.web.xmlrpc doesn't exist for Python 3 yet, but the non-XML-RPC
-# bits of this module work.
-if sys.version_info.major < 3:
- from twisted.web import xmlrpc
+from twisted.web import xmlrpc
class JSONNetstringProtocol(basic.NetstringReceiver):
diff --git a/turnip/pack/http.py b/turnip/pack/http.py
index 99635ff..89ef13a 100644
--- a/turnip/pack/http.py
+++ b/turnip/pack/http.py
@@ -16,7 +16,6 @@ try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
-import sys
import uuid
import zlib
@@ -46,6 +45,7 @@ from twisted.web import (
server,
static,
twcgi,
+ xmlrpc,
)
from turnip.helpers import compose_path
@@ -62,10 +62,6 @@ try:
from turnip.version_info import version_info
except ImportError:
version_info = {}
-# twisted.web.xmlrpc doesn't exist for Python 3 yet, but the non-XML-RPC
-# bits of this module work.
-if sys.version_info.major < 3:
- from twisted.web import xmlrpc
def fail_request(request, message, code=http.INTERNAL_SERVER_ERROR):
Follow ups