mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2024-11-14 17:40:24 -08:00
f05b09f349
Updates rarfile to 3.1 Updates stevedore to 3.5.0 Updates appdirs to 1.4.4 Updates click to 8.1.3 Updates decorator to 5.1.1 Updates dogpile.cache to 1.1.8 Updates pbr to 5.11.0 Updates pysrt to 1.1.2 Updates pytz to 2022.6 Adds importlib-metadata version 3.1.1 Adds typing-extensions version 4.1.1 Adds zipp version 3.11.0
60 lines
1.5 KiB
Python
60 lines
1.5 KiB
Python
'''
|
|
Custom exceptions raised by pytz.
|
|
'''
|
|
|
|
__all__ = [
|
|
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
|
|
'NonExistentTimeError',
|
|
]
|
|
|
|
|
|
class Error(Exception):
|
|
'''Base class for all exceptions raised by the pytz library'''
|
|
|
|
|
|
class UnknownTimeZoneError(KeyError, Error):
|
|
'''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
|
|
|
|
And also a subclass of pytz.exceptions.Error, as are other pytz
|
|
exceptions.
|
|
|
|
>>> isinstance(UnknownTimeZoneError(), Error)
|
|
True
|
|
|
|
'''
|
|
pass
|
|
|
|
|
|
class InvalidTimeError(Error):
|
|
'''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.
|
|
'''
|