New submission from Oren Milman:
The following code causes a SystemError:
class BadMetaclass(type):
def __prepare__(*args):
pass
class Foo(metaclass=BadMetaclass):
pass
This is because builtin___build_class__() assumes that __prepare__() returned a
mapping, and passes it to PyEval_EvalCodeEx(), which passes it to
_PyEval_EvalCodeWithName(), which passes it to _PyFrame_New_NoTrack(), which
raises the SystemError.
This issue seems related to #17421.
----------
components: Interpreter Core
messages: 303019
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: SystemError in class creation in case of a metaclass with a bad
__prepare__() method
type: behavior
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31588>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com