def main(): print "Test popen2 module:" try: from os import popen except ImportError: # if we don't have os.popen, check that # we have os.fork. if not, skip the test # (by raising an ImportError) from os import fork import popen2 popen2._test()
def main(): print "Test popen2 module:" if sys.platform[:4] == 'beos' and __name__ != '__main__': # Locks get messed up or something. Generally we're supposed # to avoid mixing "posix" fork & exec with native threads, and # they may be right about that after all. raise TestSkipped, "popen2() doesn't work during import on BeOS" try: from os import popen except ImportError: # if we don't have os.popen, check that # we have os.fork. if not, skip the test # (by raising an ImportError) from os import fork import popen2 popen2._test()
#! /usr/bin/env python
def main(): from os import fork # skips test through ImportError import popen2 popen2._test()