Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[svn r2959] Py3 syntax fixes in build scripts

--HG--
branch : trunk
  • Loading branch information...
commit 20ed400b4d5b62623cb11d541454655613db9e82 1 parent f9b8aa6
scoder authored
Showing with 16 additions and 8 deletions.
  1. +1 −1  setup.py
  2. +14 −6 setupinfo.py
  3. +1 −1  versioninfo.py
View
2  setup.py
@@ -38,7 +38,7 @@
# create lxml-version.h file
svn_version = versioninfo.svn_version()
versioninfo.create_version_h(svn_version)
-print "Building lxml version", svn_version
+print("Building lxml version %s." % svn_version)
branch_link = """
View
20 setupinfo.py
@@ -3,7 +3,7 @@
try:
from Cython.Distutils import build_ext as build_pyx
- print "Building with Cython."
+ print("Building with Cython.")
CYTHON_INSTALLED = True
except ImportError:
CYTHON_INSTALLED = False
@@ -131,13 +131,21 @@ def define_macros():
return macros
def flags(cmd):
- wf, rf, ef = os.popen3(cmd)
+ try:
+ import subprocess
+ except ImportError:
+ # Python 2.3
+ _, rf, ef = os.popen3(cmd)
+ else:
+ # Python 2.4+
+ p = subprocess.Popen(cmd, shell=True, close_fds=True,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ rf, ef = p.stdout, p.stderr
errors = ef.read()
if errors:
- print "ERROR:", errors
- print "** make sure the development packages of libxml2 and libxslt are installed **"
- print
- return rf.read().split()
+ print("ERROR: %s" % errors)
+ print("** make sure the development packages of libxml2 and libxslt are installed **\n")
+ return str(rf.read()).split()
def has_option(name):
try:
View
2  versioninfo.py
@@ -35,7 +35,7 @@ def svn_version():
if data.startswith('8'):
# SVN >= 1.4
- data = map(str.splitlines, data.split('\n\x0c\n'))
+ data = [ d.splitlines() for d in data.split('\n\x0c\n') ]
del data[0][0] # get rid of the '8'
dirurl = data[0][3]
try:
Please sign in to comment.
Something went wrong with that request. Please try again.