#4351: more appropriate DeprecationWarning stacklevels

This commit is contained in:
Philip Jenvey 2009-05-08 03:57:12 +00:00
parent e7d149ecf0
commit a394f2dca3
4 changed files with 9 additions and 9 deletions

View file

@ -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):