Checking in patch #103478 -- makes popen2 and fork1 tested on BeOS.
Tested for not breaking builds on Linux.
This commit is contained in:
parent
87eb4f8bb3
commit
fc3fc337d0
|
@ -6,20 +6,13 @@ child after a fork().
|
||||||
On some systems (e.g. Solaris without posix threads) we find that all
|
On some systems (e.g. Solaris without posix threads) we find that all
|
||||||
active threads survive in the child after a fork(); this is an error.
|
active threads survive in the child after a fork(); this is an error.
|
||||||
|
|
||||||
On BeOS, you CANNOT mix threads and fork(), the behaviour is undefined.
|
While BeOS doesn't officially support fork and native threading in
|
||||||
That's OK, fork() is a grotesque hack anyway. ;-) [cjh]
|
the same application, the present example should work just fine. DC
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os, sys, time, thread
|
import os, sys, time, thread
|
||||||
from test_support import verify, verbose, TestSkipped
|
from test_support import verify, verbose, TestSkipped
|
||||||
|
|
||||||
try:
|
|
||||||
if os.uname()[0] == "BeOS":
|
|
||||||
raise TestSkipped, "can't mix os.fork with threads on BeOS"
|
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.fork
|
os.fork
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
from test_support import TestSkipped
|
||||||
|
|
||||||
# popen2 contains its own testing routine
|
# popen2 contains its own testing routine
|
||||||
# which is especially useful to see if open files
|
# which is especially useful to see if open files
|
||||||
|
@ -12,6 +14,11 @@ import os
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print "Test popen2 module:"
|
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:
|
try:
|
||||||
from os import popen
|
from os import popen
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
Loading…
Reference in New Issue