mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Fix EnumValue pickling for protocol 2
This commit is contained in:
@@ -270,6 +270,10 @@ class StructGenerator(CtypesGenerator):
|
||||
def __repr__(self):
|
||||
return "{0}.{1}({2})".format(self.enum_name, self.name, hex(self))
|
||||
|
||||
# Fix pickling with protocol 2
|
||||
def __getnewargs__(self, *args):
|
||||
return self.enum_name, self.name, int(self)
|
||||
|
||||
|
||||
class EnumType(DWORD):
|
||||
values = ()
|
||||
|
||||
@@ -103,6 +103,10 @@ class EnumValue(Flag):
|
||||
def __repr__(self):
|
||||
return "{0}.{1}({2})".format(self.enum_name, self.name, hex(self))
|
||||
|
||||
# Fix pickling with protocol 2
|
||||
def __getnewargs__(self, *args):
|
||||
return self.enum_name, self.name, int(self)
|
||||
|
||||
|
||||
class EnumType(DWORD):
|
||||
values = ()
|
||||
|
||||
Reference in New Issue
Block a user