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
| 1587 | |
| 1588 | |
| 1589 | class ParserError(ValueError): |
| 1590 | """Exception subclass used for any failure to parse a datetime string. |
| 1591 | |
| 1592 | This is a subclass of :py:exc:`ValueError`, and should be raised any time |
| 1593 | earlier versions of ``dateutil`` would have raised ``ValueError``. |
| 1594 | |
| 1595 | .. versionadded:: 2.8.1 |
| 1596 | """ |
| 1597 | def __str__(self): |
| 1598 | try: |
| 1599 | return self.args[0] % self.args[1:] |
| 1600 | except (TypeError, IndexError): |
| 1601 | return super(ParserError, self).__str__() |
| 1602 | |
| 1603 | def __repr__(self): |
| 1604 | args = ", ".join("'%s'" % arg for arg in self.args) |
| 1605 | return "%s(%s)" % (self.__class__.__name__, args) |
| 1606 | |
| 1607 | |
| 1608 | class UnknownTimezoneWarning(RuntimeWarning): |
no outgoing calls