blob: f6359ce2ebf132c579d3b6ff531915c668952971 [file] [log] [blame]
Guido van Rossum59e4f371999-03-11 13:26:23 +00001#! /usr/bin/env python
2"""Test script for popen2.py
3 Christian Tismer
4"""
5
6# popen2 contains its own testing routine
7# which is especially useful to see if open files
Fredrik Lundh9407e552000-07-27 07:42:43 +00008# like stdin can be read successfully by a forked
Guido van Rossum59e4f371999-03-11 13:26:23 +00009# subprocess.
10
11def main():
Fredrik Lundh9407e552000-07-27 07:42:43 +000012 try:
13 from os import popen
14 except ImportError:
15 # if we don't have os.popen, check that
16 # we have os.fork. if not, skip the test
17 # (by raising an ImportError)
18 from os import fork
Guido van Rossum59e4f371999-03-11 13:26:23 +000019 import popen2
20 popen2._test()
21
22main()
23