summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-02-07 14:16:21 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-02-07 14:16:21 (GMT)
commitf715366f23f47832a4b9914c54d5a63b19f17eba (patch)
treeee5f60f4631f6fdad98711dc86ad128724effb11 /Lib/subprocess.py
parenta164574937d6ed32060ad34ea04913ca10741394 (diff)
downloadcpython-f715366f23f47832a4b9914c54d5a63b19f17eba.zip
cpython-f715366f23f47832a4b9914c54d5a63b19f17eba.tar.gz
cpython-f715366f23f47832a4b9914c54d5a63b19f17eba.tar.bz2
Reduce the usage of the types module.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 5d0c5e6..da63148 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -372,7 +372,6 @@ import sys
mswindows = (sys.platform == "win32")
import os
-import types
import traceback
# Exception classes used by this module.
@@ -638,7 +637,7 @@ class Popen(object):
# Detach and turn into fd
p2cwrite = p2cwrite.Detach()
p2cwrite = msvcrt.open_osfhandle(p2cwrite, 0)
- elif type(stdin) == types.IntType:
+ elif type(stdin) == int:
p2cread = msvcrt.get_osfhandle(stdin)
else:
# Assuming file-like object
@@ -652,7 +651,7 @@ class Popen(object):
# Detach and turn into fd
c2pread = c2pread.Detach()
c2pread = msvcrt.open_osfhandle(c2pread, 0)
- elif type(stdout) == types.IntType:
+ elif type(stdout) == int:
c2pwrite = msvcrt.get_osfhandle(stdout)
else:
# Assuming file-like object
@@ -668,7 +667,7 @@ class Popen(object):
errread = msvcrt.open_osfhandle(errread, 0)
elif stderr == STDOUT:
errwrite = c2pwrite
- elif type(stderr) == types.IntType:
+ elif type(stderr) == int:
errwrite = msvcrt.get_osfhandle(stderr)
else:
# Assuming file-like object
@@ -711,7 +710,7 @@ class Popen(object):
errread, errwrite):
"""Execute program (MS Windows version)"""
- if not isinstance(args, types.StringTypes):
+ if not isinstance(args, basestring):
args = list2cmdline(args)
# Process startup details
@@ -876,7 +875,7 @@ class Popen(object):
pass
elif stdin == PIPE:
p2cread, p2cwrite = os.pipe()
- elif type(stdin) == types.IntType:
+ elif type(stdin) == int:
p2cread = stdin
else:
# Assuming file-like object
@@ -886,7 +885,7 @@ class Popen(object):
pass
elif stdout == PIPE:
c2pread, c2pwrite = os.pipe()
- elif type(stdout) == types.IntType:
+ elif type(stdout) == int:
c2pwrite = stdout
else:
# Assuming file-like object
@@ -898,7 +897,7 @@ class Popen(object):
errread, errwrite = os.pipe()
elif stderr == STDOUT:
errwrite = c2pwrite
- elif type(stderr) == types.IntType:
+ elif type(stderr) == int:
errwrite = stderr
else:
# Assuming file-like object
@@ -937,7 +936,7 @@ class Popen(object):
errread, errwrite):
"""Execute program (POSIX version)"""
- if isinstance(args, types.StringTypes):
+ if isinstance(args, basestring):
args = [args]
if shell: