[issue28835] Change in behavior when overriding warnings.showwarning and with catch_warnings(record=True)

STINNER Victor report at bugs.python.org
Tue Dec 6 05:38:55 EST 2016


STINNER Victor added the comment:

Julien reviewed the pushed change and asked me questions on IRC:

* "nonlocal log": this change is unrelated to the fix, I should have done that in a separated change, sorry, I cannot resist to refactoring :-) The change has no effect, it's more cosmetic to help reviewers: "log is not a local variable nor a global variable, it's a "non-local" variable".

* inner function (calling log.append) renamed from "showarnmsg()" to "showarnmsg_logger()": it's to help debugging. It's a pain when two different functions completely different have the same name, especially for the warnings where many functions are overriden at runtime. Moreover, the function is now used for _showwarnmsg_impl instead of _showwarnmsg, so I also renamed the function to avoid confusion.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28835>
_______________________________________


More information about the Python-bugs-list mailing list