Issue #12469: test_signal checks wakeup signals order, except on freebsd6

On FreeBSD 6, when signals are unblocked, FreeBSD 6 delivers signals in the
reverse order of their number.
This commit is contained in:
Victor Stinner 2011-07-05 01:15:08 +02:00
parent 87e78ce1c6
commit 68757ac884
1 changed files with 4 additions and 4 deletions

View File

@ -240,10 +240,10 @@ class WakeupSignalTests(unittest.TestCase):
def check_signum(signals): def check_signum(signals):
data = os.read(read, len(signals)+1) data = os.read(read, len(signals)+1)
raised = struct.unpack('%uB' % len(data), data) raised = struct.unpack('%uB' % len(data), data)
# We don't care of the signal delivery order (it's not portable or if sys.platform == 'freebsd6':
# reliable) # when signals are unblocked, FreeBSD 6 delivers signals in the
raised = set(raised) # reverse order of their number
signals = set(signals) signals = tuple(sorted(signals, reverse=False))
if raised != signals: if raised != signals:
raise Exception("%r != %r" % (raised, signals)) raise Exception("%r != %r" % (raised, signals))