diff --git a/py/bin/gendoc.py b/py/bin/gendoc.py index 5099454fa..2c73cd410 100644 --- a/py/bin/gendoc.py +++ b/py/bin/gendoc.py @@ -15,7 +15,11 @@ import sys 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 diff --git a/py/execnet/register.py b/py/execnet/register.py index fbb8a0ca6..78014e988 100644 --- a/py/execnet/register.py +++ b/py/execnet/register.py @@ -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 diff --git a/py/misc/_dist.py b/py/misc/_dist.py index e83be5a0e..42cb05217 100644 --- a/py/misc/_dist.py +++ b/py/misc/_dist.py @@ -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': diff --git a/py/process/cmdexec.py b/py/process/cmdexec.py index 45211b39f..a5d03cf5d 100644 --- a/py/process/cmdexec.py +++ b/py/process/cmdexec.py @@ -24,7 +24,11 @@ def posix_exec_cmd(cmd): 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