Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_wait4.py

    r2 r391  
    44import os
    55import time
     6import sys
    67from test.fork_wait import ForkWait
    7 from test.test_support import TestSkipped, run_unittest, reap_children
     8from test.test_support import run_unittest, reap_children, get_attribute
    89
    9 try:
    10     os.fork
    11 except AttributeError:
    12     raise TestSkipped, "os.fork not defined -- skipping test_wait4"
     10# If either of these do not exist, skip this test.
     11get_attribute(os, 'fork')
     12get_attribute(os, 'wait4')
    1313
    14 try:
    15     os.wait4
    16 except AttributeError:
    17     raise TestSkipped, "os.wait4 not defined -- skipping test_wait4"
    1814
    1915class Wait4Test(ForkWait):
    2016    def wait_impl(self, cpid):
     17        option = os.WNOHANG
     18        if sys.platform.startswith('aix'):
     19            # Issue #11185: wait4 is broken on AIX and will always return 0
     20            # with WNOHANG.
     21            option = 0
    2122        for i in range(10):
    2223            # wait4() shouldn't hang, but some of the buildbots seem to hang
    2324            # in the forking tests.  This is an attempt to fix the problem.
    24             spid, status, rusage = os.wait4(cpid, os.WNOHANG)
     25            spid, status, rusage = os.wait4(cpid, option)
    2526            if spid == cpid:
    2627                break
Note: See TracChangeset for help on using the changeset viewer.