mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
issue23673
add private method to enum to support replacing global constants with Enum members: - search for candidate constants via supplied filter - create new enum class and members - insert enum class and replace constants with members via supplied module name - replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle modify IntEnum classes to use new method
This commit is contained in:
parent
d833779cea
commit
482fe0477e
4 changed files with 47 additions and 8 deletions
|
@ -1375,6 +1375,11 @@ class GeneralModuleTests(unittest.TestCase):
|
|||
with sock:
|
||||
for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
self.assertRaises(TypeError, pickle.dumps, sock, protocol)
|
||||
for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
family = pickle.loads(pickle.dumps(socket.AF_INET, protocol))
|
||||
self.assertEqual(family, socket.AF_INET)
|
||||
type = pickle.loads(pickle.dumps(socket.SOCK_STREAM, protocol))
|
||||
self.assertEqual(type, socket.SOCK_STREAM)
|
||||
|
||||
def test_listen_backlog(self):
|
||||
for backlog in 0, -1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue