Made the module compatible with Python 2.2 again.

This commit is contained in:
Peter Astrand 2005-02-21 08:13:02 +00:00
parent afd842f5b2
commit c26516b29d

View file

@ -2,6 +2,8 @@
# #
# For more information about this module, see PEP 324. # For more information about this module, see PEP 324.
# #
# This module should remain compatible with Python 2.2, see PEP 291.
#
# Copyright (c) 2003-2004 by Peter Astrand <astrand@lysator.liu.se> # Copyright (c) 2003-2004 by Peter Astrand <astrand@lysator.liu.se>
# #
# Licensed to PSF under a Contributor Agreement. # Licensed to PSF under a Contributor Agreement.
@ -374,6 +376,7 @@ import sys
mswindows = (sys.platform == "win32") mswindows = (sys.platform == "win32")
import os import os
import types
import traceback import traceback
# Exception classes used by this module. # Exception classes used by this module.
@ -712,7 +715,7 @@ class Popen(object):
errread, errwrite): errread, errwrite):
"""Execute program (MS Windows version)""" """Execute program (MS Windows version)"""
if not isinstance(args, basestring): if not isinstance(args, types.StringTypes):
args = list2cmdline(args) args = list2cmdline(args)
# Process startup details # Process startup details
@ -938,7 +941,7 @@ class Popen(object):
errread, errwrite): errread, errwrite):
"""Execute program (POSIX version)""" """Execute program (POSIX version)"""
if isinstance(args, basestring): if isinstance(args, types.StringTypes):
args = [args] args = [args]
if shell: if shell: