mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.10] bpo-45173: Note configparser deprecations will be removed in 3.12 (GH-31084)
Cherry-pick of [`b06e9ba`](https://github.com/python/cpython/pull/30952/commits/b06e9ba398fafe39028c3b2dc3943266a16b1416) from https://github.com/python/cpython/pull/30952.
This commit is contained in:
parent
e480def027
commit
ba4d79af32
2 changed files with 5 additions and 4 deletions
|
|
@ -316,7 +316,7 @@ def __init__(self, source=None, filename=None):
|
||||||
def filename(self):
|
def filename(self):
|
||||||
"""Deprecated, use `source'."""
|
"""Deprecated, use `source'."""
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"The 'filename' attribute will be removed in future versions. "
|
"The 'filename' attribute will be removed in Python 3.12. "
|
||||||
"Use 'source' instead.",
|
"Use 'source' instead.",
|
||||||
DeprecationWarning, stacklevel=2
|
DeprecationWarning, stacklevel=2
|
||||||
)
|
)
|
||||||
|
|
@ -326,7 +326,7 @@ def filename(self):
|
||||||
def filename(self, value):
|
def filename(self, value):
|
||||||
"""Deprecated, user `source'."""
|
"""Deprecated, user `source'."""
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"The 'filename' attribute will be removed in future versions. "
|
"The 'filename' attribute will be removed in Python 3.12. "
|
||||||
"Use 'source' instead.",
|
"Use 'source' instead.",
|
||||||
DeprecationWarning, stacklevel=2
|
DeprecationWarning, stacklevel=2
|
||||||
)
|
)
|
||||||
|
|
@ -757,7 +757,7 @@ def read_dict(self, dictionary, source='<dict>'):
|
||||||
def readfp(self, fp, filename=None):
|
def readfp(self, fp, filename=None):
|
||||||
"""Deprecated, use read_file instead."""
|
"""Deprecated, use read_file instead."""
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"This method will be removed in future versions. "
|
"This method will be removed in Python 3.12. "
|
||||||
"Use 'parser.read_file()' instead.",
|
"Use 'parser.read_file()' instead.",
|
||||||
DeprecationWarning, stacklevel=2
|
DeprecationWarning, stacklevel=2
|
||||||
)
|
)
|
||||||
|
|
@ -1232,7 +1232,7 @@ def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"The SafeConfigParser class has been renamed to ConfigParser "
|
"The SafeConfigParser class has been renamed to ConfigParser "
|
||||||
"in Python 3.2. This alias will be removed in future versions."
|
"in Python 3.2. This alias will be removed in Python 3.12."
|
||||||
" Use ConfigParser directly instead.",
|
" Use ConfigParser directly instead.",
|
||||||
DeprecationWarning, stacklevel=2
|
DeprecationWarning, stacklevel=2
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Note the configparser deprecations will be removed in Python 3.12.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue