mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010)
* [Enum] revert enum module to 3.9
This commit is contained in:
parent
000b9e803a
commit
9bf7c2d638
29 changed files with 1790 additions and 4872 deletions
|
@ -1,4 +1,3 @@
|
|||
import enum
|
||||
import errno
|
||||
import os
|
||||
import random
|
||||
|
@ -34,32 +33,6 @@ class GenericTests(unittest.TestCase):
|
|||
self.assertIsInstance(sig, signal.Signals)
|
||||
self.assertEqual(sys.platform, "win32")
|
||||
|
||||
CheckedSignals = enum._old_convert_(
|
||||
enum.IntEnum, 'Signals', 'signal',
|
||||
lambda name:
|
||||
name.isupper()
|
||||
and (name.startswith('SIG') and not name.startswith('SIG_'))
|
||||
or name.startswith('CTRL_'),
|
||||
source=signal,
|
||||
)
|
||||
enum._test_simple_enum(CheckedSignals, signal.Signals)
|
||||
|
||||
CheckedHandlers = enum._old_convert_(
|
||||
enum.IntEnum, 'Handlers', 'signal',
|
||||
lambda name: name in ('SIG_DFL', 'SIG_IGN'),
|
||||
source=signal,
|
||||
)
|
||||
enum._test_simple_enum(CheckedHandlers, signal.Handlers)
|
||||
|
||||
Sigmasks = getattr(signal, 'Sigmasks', None)
|
||||
if Sigmasks is not None:
|
||||
CheckedSigmasks = enum._old_convert_(
|
||||
enum.IntEnum, 'Sigmasks', 'signal',
|
||||
lambda name: name in ('SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'),
|
||||
source=signal,
|
||||
)
|
||||
enum._test_simple_enum(CheckedSigmasks, Sigmasks)
|
||||
|
||||
|
||||
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
|
||||
class PosixTests(unittest.TestCase):
|
||||
|
@ -899,7 +872,7 @@ class PendingSignalsTests(unittest.TestCase):
|
|||
|
||||
%s
|
||||
|
||||
blocked = %r
|
||||
blocked = %s
|
||||
signum = signal.SIGALRM
|
||||
|
||||
# child: block and wait the signal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue