Skip to content

Commit

Permalink
Improve documentation for parser errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pganssle committed Jan 2, 2020
1 parent cf7ca22 commit a4b2179
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dateutil/parser/_parser.py
Expand Up @@ -1593,7 +1593,13 @@ def _parsetz(tzstr):


class ParserError(ValueError):
"""Error class for representing failure to parse a datetime string."""
"""Exception subclass used for any failure to parse a datetime string.
This is a subclass of :py:exc:`ValueError`, and should be raised any time
earlier versions of ``dateutil`` would have raised ``ValueError``.
.. versionadded:: 2.8.1
"""
def __str__(self):
try:
return self.args[0] % self.args[1:]
Expand All @@ -1605,5 +1611,8 @@ def __repr__(self):


class UnknownTimezoneWarning(RuntimeWarning):
"""Raised when the parser finds a timezone it cannot parse into a tzinfo"""
"""Raised when the parser finds a timezone it cannot parse into a tzinfo.
.. versionadded:: 2.7.0
"""
# vim:ts=4:sw=4:et

0 comments on commit a4b2179

Please sign in to comment.