-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-21983: Fix a crash in ctypes.cast() in case the type argument is a ctypes structured data type. #3859
Conversation
array = array_type() | ||
self.assertRaises(TypeError, cast, array, None) | ||
self.assertRaises(TypeError, cast, array, array_type) | ||
class Struct(Structure): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if cpython does this, but linking to the bug number in the test might be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix looks obviously correct to me, and I can verify the test fails without it.
…ed data type (pythonGH-3859) (cherry picked from commit d518d8b) Co-authored-by: Oren Milman <orenmn@gmail.com>
GH-6745 is a backport of this pull request to the 3.7 branch. |
Sorry, @orenmn and @zooba, I could not cleanly backport this to |
…ed data type (pythonGH-3859) (cherry picked from commit d518d8b) Co-authored-by: Oren Milman <orenmn@gmail.com>
GH-6746 is a backport of this pull request to the 3.6 branch. |
sorry Eric, but i am too busy nowadays... |
In addition, add tests to
test_ctypes
to make sure thatcast()
raises aTypeError
in case of a bad type argument (and doesn't crash).https://bugs.python.org/issue21983