mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
Also updates: - appdirs-1.4.3 - babelfish-0.5.5 - beautifulsoup4-4.6.3 - certifi-2018.11.29 - chardet-3.0.4 - click-7.0 - decorator-4.3.0 - dogpile.cache-0.7.1 - enzyme-0.4.1 - guessit-3.0.3 - idna-2.8 - pbr-5.1.1 - pysrt-1.1.1 - python-dateutil-2.7.5 - pytz-2018.7 - rarfile-3.0 - rebulk-1.0.0 - requests-2.21.0 - six-1.12.0 - stevedore-1.30.0 - urllib3-1.24.1
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
'''
|
|
Custom exceptions raised by pytz.
|
|
'''
|
|
|
|
__all__ = [
|
|
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
|
|
'NonExistentTimeError',
|
|
]
|
|
|
|
|
|
class UnknownTimeZoneError(KeyError):
|
|
'''Exception raised when pytz is passed an unknown timezone.
|
|
|
|
>>> isinstance(UnknownTimeZoneError(), LookupError)
|
|
True
|
|
|
|
This class is actually a subclass of KeyError to provide backwards
|
|
compatibility with code relying on the undocumented behavior of earlier
|
|
pytz releases.
|
|
|
|
>>> isinstance(UnknownTimeZoneError(), KeyError)
|
|
True
|
|
'''
|
|
pass
|
|
|
|
|
|
class InvalidTimeError(Exception):
|
|
'''Base class for invalid time exceptions.'''
|
|
|
|
|
|
class AmbiguousTimeError(InvalidTimeError):
|
|
'''Exception raised when attempting to create an ambiguous wallclock time.
|
|
|
|
At the end of a DST transition period, a particular wallclock time will
|
|
occur twice (once before the clocks are set back, once after). Both
|
|
possibilities may be correct, unless further information is supplied.
|
|
|
|
See DstTzInfo.normalize() for more info
|
|
'''
|
|
|
|
|
|
class NonExistentTimeError(InvalidTimeError):
|
|
'''Exception raised when attempting to create a wallclock time that
|
|
cannot exist.
|
|
|
|
At the start of a DST transition period, the wallclock time jumps forward.
|
|
The instants jumped over never occur.
|
|
'''
|