diff options
| author | Sergey Schetinin <sergey@maluke.com> | 2011-07-08 01:43:00 +0300 |
|---|---|---|
| committer | Sergey Schetinin <sergey@maluke.com> | 2011-07-08 01:43:00 +0300 |
| commit | c16b180678a91e8a0734586daf6950fb6cd55718 (patch) | |
| tree | 60c1d2c10807e59363bf4aa56a31765ef78fa0ef /webob/acceptparse.py | |
| parent | e24e4b5ce5805418e15b5b41ef000fd1a16cca36 (diff) | |
| download | webob-c16b180678a91e8a0734586daf6950fb6cd55718.tar.gz | |
* add warn_deprecation(...) mechanism that centralizes the deprecation warnings / exceptions based on current WebOb version
* deprecated_property is only used to throw exception now, simplify accordingly
* remove check for cls.charset, cls.default_charset in BaseRequest.__init__ (they were deprecated long enough, for us to allow subclasses to use them as they wish)
Diffstat (limited to 'webob/acceptparse.py')
| -rw-r--r-- | webob/acceptparse.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/webob/acceptparse.py b/webob/acceptparse.py index c74c254..af2cab3 100644 --- a/webob/acceptparse.py +++ b/webob/acceptparse.py @@ -9,8 +9,8 @@ Where the ``q`` parameter is optional. In theory other parameters exists, but this ignores them. """ -import re, warnings -from webob.util import header_docstring +import re +from webob.util import header_docstring, warn_deprecation from webob.headers import _trans_name as header_to_key part_re = re.compile( @@ -42,14 +42,8 @@ def parse_accept(value): return result def _warn_first_match(): - # TODO: change to DeprecationWarning in version 1.1 - # TODO: raise exc in in version 1.2 # TODO: remove .first_match in version 1.3 - warnings.warn( - "Use best_match instead", - PendingDeprecationWarning, - stacklevel=3, - ) + warn_deprecation("Use best_match instead", '1.2', 3) class Accept(object): """ |
