Message262384
It looks like logging a warning at Python exit always works on Python 2.7:
---
import _warnings
class Bla:
def __del__(self, w=_warnings):
w.warn_explicit('message', DeprecationWarning, 'x.py', 5)
bla = Bla()
---
It looks like it uses the Python implementation and linecache.getline() always works. Maybe the warning is emitted earlier that the Python 3 code emitting ResourceWarning. I see that warnings.py of Python 2 imports linecache at top level, whereas the Python 3 code imports the module at the first use in showwarning(). I recall that imports at top level are avoided to get faster startup time. |
|
Date |
User |
Action |
Args |
2016-03-24 23:15:09 | vstinner | set | recipients:
+ vstinner, pitrou, ned.deily, Arfrever, python-dev, serhiy.storchaka, msmhrt |
2016-03-24 23:15:09 | vstinner | set | messageid: <1458861309.87.0.922704195885.issue21925@psf.upfronthosting.co.za> |
2016-03-24 23:15:09 | vstinner | link | issue21925 messages |
2016-03-24 23:15:09 | vstinner | create | |
|