Skip to content

Commit

Permalink
add !r to parse_isodate error message
Browse files Browse the repository at this point in the history
  • Loading branch information
pawl committed May 20, 2021
1 parent c0aef4b commit f28e639
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dateutil/parser/isoparser.py
Expand Up @@ -159,7 +159,7 @@ def parse_isodate(self, datestr):
components, pos = self._parse_isodate(datestr)
if pos < len(datestr):
raise ValueError('String contains unknown ISO ' +
'components: {}'.format(datestr.decode('ascii')))
'components: {!r}'.format(datestr.decode('ascii')))
return date(*components)

@_takes_ascii
Expand Down
2 changes: 1 addition & 1 deletion dateutil/test/test_isoparser.py
Expand Up @@ -408,7 +408,7 @@ def test_parse_isodate_error_text():
isoparser().parse_isodate('2014-0423')

# ensure the error message does not contain b' prefixes
expected_error = "String contains unknown ISO components: 2014-0423"
expected_error = "String contains unknown ISO components: '2014-0423'"
assert expected_error == str(excinfo.value)


Expand Down

0 comments on commit f28e639

Please sign in to comment.