Message 224903 - Python tracker (original) (raw)
Here's an updated patch (based on Vajrasky's patch, thanks!).
Changes:
Updated deprecation schedule
- pending deprecation in 3.5
- deprecation in 3.6
- removal in 3.7
Added tests
Added a whatsnew entry
Moved warnings import to dist() and linux_distribution() functions
Used a deprecate-removed directive in the documentation (see also issue 22150)
Fixed a stacklevel bug. With deprecate_platform_dist_v2.patch the output of platform.dist() was:
import platform as p p.dist() /home/berker/projects/cpython/default/Lib/platform.py:373: PendingDeprecationWarning: The dist()/linux_distribution() function will be deprecated in Python 3.5 and removed in Python 3.6 full_distribution_name=0) ('debian', 'wheezy/sid', '')
With the current patch:
import platform as p p.dist() main:1: PendingDeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5 and will be removed in Python 3.6 ('debian', 'wheezy/sid', '')