Compare commits
2 Commits
7acfe41257
...
fbffda25b4
Author | SHA1 | Date |
---|---|---|
Miss Islington (bot) | fbffda25b4 | |
Miss Islington (bot) | 51f5029146 |
|
@ -227,10 +227,10 @@ class EnumMeta(type):
|
||||||
# create our new Enum type
|
# create our new Enum type
|
||||||
if bases:
|
if bases:
|
||||||
bases = (_NoInitSubclass, ) + bases
|
bases = (_NoInitSubclass, ) + bases
|
||||||
enum_class = type.__new__(metacls, cls, bases, classdict)
|
enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
|
||||||
enum_class.__bases__ = enum_class.__bases__[1:] #or (object, )
|
enum_class.__bases__ = enum_class.__bases__[1:] #or (object, )
|
||||||
else:
|
else:
|
||||||
enum_class = type.__new__(metacls, cls, bases, classdict)
|
enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
|
||||||
old_init_subclass = getattr(enum_class, '__init_subclass__', None)
|
old_init_subclass = getattr(enum_class, '__init_subclass__', None)
|
||||||
# and restore the new one (if there was one)
|
# and restore the new one (if there was one)
|
||||||
if new_init_subclass is not None:
|
if new_init_subclass is not None:
|
||||||
|
|
|
@ -14,6 +14,6 @@ the user build or load random bytecodes anyway. Otherwise, this is a
|
||||||
|
|
||||||
import types
|
import types
|
||||||
|
|
||||||
co = types.CodeType(0, 0, 0, 0, 0, b'\x04\x71\x00\x00',
|
co = types.CodeType(0, 0, 0, 0, 0, 0, b'\x04\x00\x71\x00',
|
||||||
(), (), (), '', '', 1, b'')
|
(), (), (), '', '', 1, b'')
|
||||||
exec(co)
|
exec(co)
|
||||||
|
|
Loading…
Reference in New Issue