Message249089
Is it really *impossible* to "correctly issue a deprecation warning for a module", as the title asserts? Or does the new import system simply make it *tiresome*?
if sys.version_info.major == 3 and sys.version_info.minor == 4:
stacklevel = 8
elif sys.version_info.major == 3 and sys.version_info.minor == 4:
stacklevel = 10
else:
stacklevel = 2 # I bet they fixed it in 3.6!
warnings.warn("{} is deprecated".format(__name__), DeprecationWarning,
stacklevel=stacklevel)
That's Python for you, doing six "impossible" things before breakfast. |
|
Date |
User |
Action |
Args |
2015-08-25 00:32:07 | larry | set | recipients:
+ larry, barry, brett.cannon, ncoghlan, jwilk, Arfrever, njs, eric.snow, takluyver, berker.peksag, serhiy.storchaka, josh.r |
2015-08-25 00:32:07 | larry | set | messageid: <1440462727.25.0.0935518967849.issue24305@psf.upfronthosting.co.za> |
2015-08-25 00:32:07 | larry | link | issue24305 messages |
2015-08-25 00:32:06 | larry | create | |
|