Source

subvertpy-patches / py3k.diff

Full commit
# HG changeset patch
# Parent f08bbcbae20616bb589194e789af19c875a88606
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
setup: py3k support.


diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,6 +9,7 @@ from distutils import log
 import sys
 import os
 import re
+import subprocess
 
 # Build instructions for Windows:
 # * Install the SVN dev kit ZIP for Windows from
@@ -37,7 +38,8 @@ class CommandException(Exception):
 
 def run_cmd(cmd, arg):
     """Run specified command with given arguments, handling status"""
-    f = os.popen("'%s' %s" % (cmd, arg))
+    f = subprocess.Popen("'%s' %s" % (cmd, arg),
+                         shell=True, bufsize=bufsize, stdout=PIPE).stdout
     dir = f.read().rstrip("\n")
     status = f.close()
     if status is None:
@@ -66,7 +68,7 @@ def apr_config(arg):
                 res = run_cmd(cmd, arg)
                 apr_config_cmd = cmd
                 break
-            except CommandException, e:
+            except CommandException as e:
                 if not e.not_found():
                     raise
         else: