Permalink
Browse files

Do not use the deprecated ValueError.message

  • Loading branch information...
1 parent dcb866e commit 72efcf32c0957a7c6e709cd619cd9c49b93bbced @SimonSapin SimonSapin committed Apr 26, 2012
Showing with 3 additions and 7 deletions.
  1. +1 −1 docs/parsing.rst
  2. +1 −5 tinycss/parsing.py
  3. +1 −1 tinycss/tests/__init__.py
View
@@ -19,7 +19,7 @@ and parse a stylesheet:
>>> stylesheet.rules
[<ImportRule 1:1 foo.css>, <RuleSet at 2:5 p.error>, <PageRule 3:5 (u'tables', None)>]
>>> stylesheet.errors
- [<ParseError: Parse error at 2:29, unknown at-rule in stylesheet context: @lorem-ipsum>]
+ [ParseError(u'Parse error at 2:29, unknown at-rule in stylesheet context: @lorem-ipsum',)]
You’ll get a :class:`~tinycss.css21.Stylesheet` object which contains
all the parsed content as well as a list of encountered errors.
View
@@ -161,9 +161,5 @@ def __init__(self, subject, reason):
self.line = subject.line
self.column = subject.column
self.reason = reason
- self.msg = self.message = (
+ super(ParseError, self).__init__(
'Parse error at {0.line}:{0.column}, {0.reason}'.format(self))
- super(ParseError, self).__init__(self.message)
-
- def __repr__(self):
- return ('<{0.__class__.__name__}: {0.message}>'.format(self))
@@ -15,4 +15,4 @@ def assert_errors(errors, expected_errors):
"""Test not complete error messages but only substrings."""
assert len(errors) == len(expected_errors)
for error, expected in zip(errors, expected_errors):
- assert expected in error.message
+ assert expected in str(error)

0 comments on commit 72efcf3

Please sign in to comment.