Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a394f2dc
Commit
a394f2dc
authored
May 08, 2009
by
Philip Jenvey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4351: more appropriate DeprecationWarning stacklevels
parent
e7d149ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
Lib/cgi.py
Lib/cgi.py
+2
-2
Lib/gzip.py
Lib/gzip.py
+1
-1
Lib/plistlib.py
Lib/plistlib.py
+5
-5
Lib/string.py
Lib/string.py
+1
-1
No files found.
Lib/cgi.py
View file @
a394f2dc
...
...
@@ -163,13 +163,13 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
def
parse_qs
(
qs
,
keep_blank_values
=
0
,
strict_parsing
=
0
):
"""Parse a query given as a string argument."""
warn
(
"cgi.parse_qs is deprecated, use urllib.parse.parse_qs instead"
,
DeprecationWarning
)
DeprecationWarning
,
2
)
return
urllib
.
parse
.
parse_qs
(
qs
,
keep_blank_values
,
strict_parsing
)
def
parse_qsl
(
qs
,
keep_blank_values
=
0
,
strict_parsing
=
0
):
"""Parse a query given as a string argument."""
warn
(
"cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead"
,
DeprecationWarning
)
DeprecationWarning
,
2
)
return
urllib
.
parse
.
parse_qsl
(
qs
,
keep_blank_values
,
strict_parsing
)
def
parse_multipart
(
fp
,
pdict
):
...
...
Lib/gzip.py
View file @
a394f2dc
...
...
@@ -136,7 +136,7 @@ class GzipFile:
@
property
def
filename
(
self
):
import
warnings
warnings
.
warn
(
"use the name attribute"
,
DeprecationWarning
)
warnings
.
warn
(
"use the name attribute"
,
DeprecationWarning
,
2
)
if
self
.
mode
==
WRITE
and
self
.
name
[
-
3
:]
!=
".gz"
:
return
self
.
name
+
".gz"
return
self
.
name
...
...
Lib/plistlib.py
View file @
a394f2dc
...
...
@@ -263,13 +263,13 @@ class _InternalDict(dict):
raise
AttributeError
(
attr
)
from
warnings
import
warn
warn
(
"Attribute access from plist dicts is deprecated, use d[key] "
"notation instead"
,
PendingDeprecationWarning
)
"notation instead"
,
PendingDeprecationWarning
,
2
)
return
value
def
__setattr__
(
self
,
attr
,
value
):
from
warnings
import
warn
warn
(
"Attribute access from plist dicts is deprecated, use d[key] "
"notation instead"
,
PendingDeprecationWarning
)
"notation instead"
,
PendingDeprecationWarning
,
2
)
self
[
attr
]
=
value
def
__delattr__
(
self
,
attr
):
...
...
@@ -279,14 +279,14 @@ class _InternalDict(dict):
raise
AttributeError
(
attr
)
from
warnings
import
warn
warn
(
"Attribute access from plist dicts is deprecated, use d[key] "
"notation instead"
,
PendingDeprecationWarning
)
"notation instead"
,
PendingDeprecationWarning
,
2
)
class
Dict
(
_InternalDict
):
def
__init__
(
self
,
**
kwargs
):
from
warnings
import
warn
warn
(
"The plistlib.Dict class is deprecated, use builtin dict instead"
,
PendingDeprecationWarning
)
PendingDeprecationWarning
,
2
)
super
().
__init__
(
**
kwargs
)
...
...
@@ -299,7 +299,7 @@ class Plist(_InternalDict):
def
__init__
(
self
,
**
kwargs
):
from
warnings
import
warn
warn
(
"The Plist class is deprecated, use the readPlist() and "
"writePlist() functions instead"
,
PendingDeprecationWarning
)
"writePlist() functions instead"
,
PendingDeprecationWarning
,
2
)
super
().
__init__
(
**
kwargs
)
def
fromFile
(
cls
,
pathOrFile
):
...
...
Lib/string.py
View file @
a394f2dc
...
...
@@ -51,7 +51,7 @@ def maketrans(frm: bytes, to: bytes) -> bytes:
"""
import warnings
warnings.warn("string.maketrans is deprecated, use bytes.maketrans instead",
DeprecationWarning)
DeprecationWarning
, 2
)
if len(frm) != len(to):
raise ValueError("maketrans arguments must have same length")
if not (isinstance(frm, bytes) and isinstance(to, bytes)):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment