| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It now raises an exception if sys.modules doesn't hold a strong reference to the module. Elaborate the comment explaining why a weak reference is used to create a borrowed reference.
| Py_DECREF(ref); | ||
| Py_XDECREF(mod); | ||
|
|
||
| if (mod == NULL && !PyErr_Occurred()) { |
There was a problem hiding this comment.
I am not sure that comparing mod with NULL after Py_XDECREF does not have an undefined behavior. AFAIK, you can do nothing with a pointer to released memory, not even compare it with NULL.
Sorry, something went wrong.
There was a problem hiding this comment.
See comments of my PR #105998: IMO most of this code is useless and can be removed.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
It now raises an exception if sys.modules doesn't hold a strong reference to the module.
Elaborate the comment explaining why a weak reference is used to create a borrowed reference.