subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1742819 - in /subversion/trunk/tools/server-side/svnpubsub: irkerbridge.py svntweet.py
Date Sun, 08 May 2016 13:42:41 GMT
Author: stefan2
Date: Sun May  8 13:42:41 2016
New Revision: 1742819

URL: http://svn.apache.org/viewvc?rev=1742819&view=rev
Log:
Replace Python 2 -only imports by pairs of Python 2 / 3 alternative imports
outside out build & test scripts.

* tools/server-side/svnpubsub/irkerbridge.py
* tools/server-side/svnpubsub/svntweet.py
  (): The urlparse module has been replaced by the urllib.parse in Python 3.

Modified:
    subversion/trunk/tools/server-side/svnpubsub/irkerbridge.py
    subversion/trunk/tools/server-side/svnpubsub/svntweet.py

Modified: subversion/trunk/tools/server-side/svnpubsub/irkerbridge.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/irkerbridge.py?rev=1742819&r1=1742818&r2=1742819&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/irkerbridge.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/irkerbridge.py Sun May  8 13:42:41 2016
@@ -86,7 +86,6 @@ import sys
 import posixpath
 import socket
 import json
-import urlparse
 import optparse
 import ConfigParser
 import traceback
@@ -95,6 +94,14 @@ import re
 import fnmatch
 from string import Template
 
+try:
+  # Python >=3.0
+  from urllib.parse import urlparse
+except ImportError:
+  # Python <3.0
+  from urlparse import urlparse
+
+
 # Packages that come with svnpubsub
 import svnpubsub.client
 import daemonize

Modified: subversion/trunk/tools/server-side/svnpubsub/svntweet.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svntweet.py?rev=1742819&r1=1742818&r2=1742819&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svntweet.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svntweet.py Sun May  8 13:42:41 2016
@@ -42,7 +42,13 @@ from twisted.internet import defer, reac
 from twisted.python import failure, log
 from twisted.web.client import HTTPClientFactory, HTTPPageDownloader
 
-from urlparse import urlparse
+try:
+  # Python >=3.0
+  from urllib.parse import urlparse
+except ImportError:
+  # Python <3.0
+  from urlparse import urlparse
+
 import time
 import posixpath
 



Mime
View raw message