Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc3fc33

Browse files
author
Moshe Zadka
committed
Checking in patch #103478 -- makes popen2 and fork1 tested on BeOS.
Tested for not breaking builds on Linux.
1 parent 87eb4f8 commit fc3fc33

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

Lib/test/test_fork1.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,13 @@
66
On some systems (e.g. Solaris without posix threads) we find that all
77
active threads survive in the child after a fork(); this is an error.
88
9-
On BeOS, you CANNOT mix threads and fork(), the behaviour is undefined.
10-
That's OK, fork() is a grotesque hack anyway. ;-) [cjh]
11-
9+
While BeOS doesn't officially support fork and native threading in
10+
the same application, the present example should work just fine. DC
1211
"""
1312

1413
import os, sys, time, thread
1514
from test_support import verify, verbose, TestSkipped
1615

17-
try:
18-
if os.uname()[0] == "BeOS":
19-
raise TestSkipped, "can't mix os.fork with threads on BeOS"
20-
except AttributeError:
21-
pass
22-
2316
try:
2417
os.fork
2518
except AttributeError:

Lib/test/test_popen2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"""
55

66
import os
7+
import sys
8+
from test_support import TestSkipped
79

810
# popen2 contains its own testing routine
911
# which is especially useful to see if open files
@@ -12,6 +14,11 @@
1214

1315
def main():
1416
print "Test popen2 module:"
17+
if sys.platform[:4] == 'beos' and __name__ != '__main__':
18+
# Locks get messed up or something. Generally we're supposed
19+
# to avoid mixing "posix" fork & exec with native threads, and
20+
# they may be right about that after all.
21+
raise TestSkipped, "popen2() doesn't work during import on BeOS"
1522
try:
1623
from os import popen
1724
except ImportError:

0 commit comments

Comments
 (0)