GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — gh-146102: Catch PyErr_NewException() failure in zlib by vstinner · Pull Request #151342 · python/cpython Conversation
|
|
See the report: https://gist.github.com/devdanzin/ada54523342276bbdb66228de2ec863e |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (state->ZlibError == NULL) { | ||
| return -1; | ||
| } | ||
| if (PyModule_AddObjectRef(mod, "error", state->ZlibError) < 0) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This isn't strictly necessary, PyModule_AddObjectRef will return -1 if it's NULL. Looking at other modules, they also follow this pattern.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right! I checked PyModule_AddObjectRef() documentation and it's well documented:
To be convenient, the function accepts
NULLvalue with an exception
set. In this case, return-1and just leave the raised exception
unchanged.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This change is not needed. I close the PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.