diff options
author | Oren Milman <orenmn@gmail.com> | 2017-09-27 14:04:37 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2017-09-27 14:04:37 (GMT) |
commit | 5837d0418f47933b2e3c139bdee8a79c248a943c (patch) | |
tree | a3b7dfdca108fe5b67d63a878f85c2b829f4fe41 /Misc | |
parent | 236329ed9fee01edb85d698d30682e304439d198 (diff) | |
download | cpython-5837d0418f47933b2e3c139bdee8a79c248a943c.zip cpython-5837d0418f47933b2e3c139bdee8a79c248a943c.tar.gz cpython-5837d0418f47933b2e3c139bdee8a79c248a943c.tar.bz2 |
bpo-31588: Validate return value of __prepare__() methods (GH-3764)
Class execution requires that __prepare__() methods return
a proper execution namespace. Check for that immediately
after calling __prepare__(), rather than passing it through
to the code execution machinery and potentially triggering
SystemError (in debug builds) or a cryptic TypeError
(in release builds).
Patch by Oren Milman.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2017-09-26-13-03-16.bpo-31588.wT9Iy7.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-09-26-13-03-16.bpo-31588.wT9Iy7.rst b/Misc/NEWS.d/next/Core and Builtins/2017-09-26-13-03-16.bpo-31588.wT9Iy7.rst new file mode 100644 index 0000000..44a7aba --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2017-09-26-13-03-16.bpo-31588.wT9Iy7.rst @@ -0,0 +1,2 @@ +Raise a `TypeError` with a helpful error message when class creation fails +due to a metaclass with a bad ``__prepare__()`` method. Patch by Oren Milman. |