Brett Cannon added the comment:

So there are two approaches I see to solving this whole thing. One is for there 
to be a slight divergence between the C code and the Python code. For 
_warnings.warn(), nothing changes. For warnings.warn(), though, it does the 
expected frame skipping. This would mean that _warnings.warn() continues to 
exist for startup purposes but then user-level code and non-startup code uses 
the Python version that has the expected semantics. This requires figuring out 
why not importing _warnings.warn in warnings.py causes test failures.

The other option is someone helps me figure out why the C code is causing its 
test failures by triggering a -11 return in threaded/subprocess tests and 
prevent the divergence.

I have opened issue #24938 to actually re-evaluate one of the key points of 
_warnings.c which was startup performance. This was done about 7 years ago 
which pre-dates freezing code and providing simple C wrappers as necessary for 
internal use in Python like we do with importlib.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24305>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to