summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-03-23 18:18:35 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-03-23 18:18:35 (GMT)
commitbd8dbab247e980920cab7710d4707ccbf60a30b1 (patch)
tree7ec6faf19757bd922f95f8327f6569b2bfc222f2 /Lib
parent83be9669c8c0009dadc0f1fbc0e07a1511223003 (diff)
downloadcpython-bd8dbab247e980920cab7710d4707ccbf60a30b1.zip
cpython-bd8dbab247e980920cab7710d4707ccbf60a30b1.tar.gz
cpython-bd8dbab247e980920cab7710d4707ccbf60a30b1.tar.bz2
Preserve command name, for later printing of active
commands. If there are active commands when the tests start, fail, printing these commands.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/popen2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/popen2.py b/Lib/popen2.py
index 54543be..a4eda39 100644
--- a/Lib/popen2.py
+++ b/Lib/popen2.py
@@ -39,6 +39,7 @@ class Popen3:
specified, it specifies the size of the I/O buffers to/from the child
process."""
_cleanup()
+ self.cmd = cmd
p2cread, p2cwrite = os.pipe()
c2pread, c2pwrite = os.pipe()
if capturestderr:
@@ -186,6 +187,9 @@ else:
__all__.extend(["Popen3", "Popen4"])
def _test():
+ # When the test runs, there shouldn't be any open pipes
+ _cleanup()
+ assert not _active, "Active pipes when test starts " + repr([c.cmd for c in _active])
cmd = "cat"
teststr = "ab cd\n"
if os.name == "nt":