| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
There are many ways to handle this issue and this way looks the right way to me.
Sorry, something went wrong.
| with support.swap_item(globals(), '__name__', b'foo'), \ | ||
| support.swap_item(globals(), '__file__', None), \ | ||
| support.captured_stderr(): | ||
| self.module.warn('bar') |
There was a problem hiding this comment.
Raise an exception with -Werror.
Sorry, something went wrong.
| /* Setup module. */ | ||
| *module = PyDict_GetItemString(globals, "__name__"); | ||
| if (*module == NULL) { | ||
| if (*module == NULL || |
There was a problem hiding this comment.
This expression is slightly hard to understand. I would rewrite it as
if (*module == Py_None || (*module != NULL && PyUnicode_Check(*module))) {
Py_INCREF(*module);
}
else {
...
or
if (*module != NULL && (*module == Py_None || PyUnicode_Check(*module))) {
Py_INCREF(*module);
}
else {
...
Sorry, something went wrong.
|
Thanks @orenmn for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6. |
Sorry, something went wrong.
|
GH-3730 is a backport of this pull request to the 3.6 branch. |
Sorry, something went wrong.
… of a bad __name__ global. (pythonGH-3717) (cherry picked from commit 5d3e800)
|
Thanks @orenmn for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7. |
Sorry, something went wrong.
|
Sorry, @orenmn and @serhiy-storchaka, I could not cleanly backport this to 2.7 due to a conflict. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue31566