[py-svn] r61975 - in py/trunk/py: bin execnet misc process

getxsick at codespeak.net getxsick at codespeak.net
Tue Feb 17 18:24:42 CET 2009


Author: getxsick
Date: Tue Feb 17 18:24:41 2009
New Revision: 61975

Modified:
   py/trunk/py/bin/gendoc.py
   py/trunk/py/execnet/register.py
   py/trunk/py/misc/_dist.py
   py/trunk/py/process/cmdexec.py
Log:
subprocess is in stdlib since 2.4
for backwards compatibility we use compat.subprocess if needed


Modified: py/trunk/py/bin/gendoc.py
==============================================================================
--- py/trunk/py/bin/gendoc.py	(original)
+++ py/trunk/py/bin/gendoc.py	Tue Feb 17 18:24:41 2009
@@ -15,7 +15,11 @@
 sys.path.insert(0, '.')
 
 import py
-import os, subprocess
+import os
+try:
+    import subprocess
+except ImportError:
+    from py.__.compat import subprocess
 
 def sysexec(cmd):
     print "executing", cmd

Modified: py/trunk/py/execnet/register.py
==============================================================================
--- py/trunk/py/execnet/register.py	(original)
+++ py/trunk/py/execnet/register.py	Tue Feb 17 18:24:41 2009
@@ -1,10 +1,14 @@
 
 import os, inspect, socket
-from subprocess import Popen, PIPE
 import sys
 from py.magic import autopath ; mypath = autopath()
 from py.__.misc.warn import APIWARN
 
+try:
+    from subprocess import Popen, PIPE
+except ImportError:
+    from py.__.compat.subprocess import Popen, PIPE
+
 import py
 if sys.platform == "win32":
     win32 = True

Modified: py/trunk/py/misc/_dist.py
==============================================================================
--- py/trunk/py/misc/_dist.py	(original)
+++ py/trunk/py/misc/_dist.py	Tue Feb 17 18:24:41 2009
@@ -1,8 +1,11 @@
 import py
 import sys, os, re
-import subprocess
 from distutils import sysconfig
 from distutils import core 
+try:
+    import subprocess
+except ImportError:
+    from py.__.compat import subprocess
 
 winextensions = 1
 if sys.platform == 'win32':

Modified: py/trunk/py/process/cmdexec.py
==============================================================================
--- py/trunk/py/process/cmdexec.py	(original)
+++ py/trunk/py/process/cmdexec.py	Tue Feb 17 18:24:41 2009
@@ -24,7 +24,11 @@
     the error-output from the command.
     """
     __tracebackhide__ = True
-    from subprocess import Popen, PIPE
+    try:
+        from subprocess import Popen, PIPE
+    except ImportError:
+        from py.__.compat.subprocess import Popen, PIPE
+
     import errno
 
     #print "execing", cmd



More information about the pytest-commit mailing list