bpo-44980: fix test_constructor to return None value#27898
Conversation
|
It might also be good to test contents of the null tuple? |
|
You could but since we weren't looking at those before, this is new behavior that isn't necessarily the point of this PR. |
|
🤖 New build scheduled with the buildbot fleet by @ambv for commit 0d986418e50ab4f029845fa115976a5837a0a450 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
|
"test-with-buildbots" will test for refleaks for us. |
Modules/_testcapimodule.c
Outdated
There was a problem hiding this comment.
If tuple is NULL, the result should be NULL.
There was a problem hiding this comment.
I should wait for buildbots to finish to push this change right?
There was a problem hiding this comment.
No, you do not need to wait for buildbots.
|
Refleaks bot failure seems unrelated: 2:10:42 load avg: 5.18 [ 58/428/1] test_mailbox failed (1 failure) (2 hour 31 sec) -- running: test_gzip (1 hour 44 min), test_cmd_line (1 hour 39 min), test_argparse (1 hour 39 min) |
Modules/_testcapimodule.c
Outdated
There was a problem hiding this comment.
o1 and o2 may be leaked here.
Modules/_testcapimodule.c
Outdated
There was a problem hiding this comment.
No, you do not need to wait for buildbots.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Looking at the history of test_null_strings I decided that it should be completely rewritten. #27904.
Modules/_testcapimodule.c
Outdated
There was a problem hiding this comment.
BTW, comparing a pointer to freed memory with NULL is undefined behavior. Py_DECREF(tuple) should be after if (tuple == NULL).
There was a problem hiding this comment.
Looks like I've forgotten what I knew of C; thanks for reviewing and catching this!
74de888 to
87c0f83
Compare
|
I rebased on |
|
GH-27913 is a backport of this pull request to the 3.10 branch. |
(cherry picked from commit 27b761a) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
(cherry picked from commit 27b761a) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
|
GH-27914 is a backport of this pull request to the 3.9 branch. |
@ambv thanks, I'll make sure to do that next time! |
Update test_constructor() to conform to deprecation in #27748
https://bugs.python.org/issue44980