annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pytz/exceptions.py @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 '''
jpayne@68 2 Custom exceptions raised by pytz.
jpayne@68 3 '''
jpayne@68 4
jpayne@68 5 __all__ = [
jpayne@68 6 'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
jpayne@68 7 'NonExistentTimeError',
jpayne@68 8 ]
jpayne@68 9
jpayne@68 10
jpayne@68 11 class Error(Exception):
jpayne@68 12 '''Base class for all exceptions raised by the pytz library'''
jpayne@68 13
jpayne@68 14
jpayne@68 15 class UnknownTimeZoneError(KeyError, Error):
jpayne@68 16 '''Exception raised when pytz is passed an unknown timezone.
jpayne@68 17
jpayne@68 18 >>> isinstance(UnknownTimeZoneError(), LookupError)
jpayne@68 19 True
jpayne@68 20
jpayne@68 21 This class is actually a subclass of KeyError to provide backwards
jpayne@68 22 compatibility with code relying on the undocumented behavior of earlier
jpayne@68 23 pytz releases.
jpayne@68 24
jpayne@68 25 >>> isinstance(UnknownTimeZoneError(), KeyError)
jpayne@68 26 True
jpayne@68 27
jpayne@68 28 And also a subclass of pytz.exceptions.Error, as are other pytz
jpayne@68 29 exceptions.
jpayne@68 30
jpayne@68 31 >>> isinstance(UnknownTimeZoneError(), Error)
jpayne@68 32 True
jpayne@68 33
jpayne@68 34 '''
jpayne@68 35 pass
jpayne@68 36
jpayne@68 37
jpayne@68 38 class InvalidTimeError(Error):
jpayne@68 39 '''Base class for invalid time exceptions.'''
jpayne@68 40
jpayne@68 41
jpayne@68 42 class AmbiguousTimeError(InvalidTimeError):
jpayne@68 43 '''Exception raised when attempting to create an ambiguous wallclock time.
jpayne@68 44
jpayne@68 45 At the end of a DST transition period, a particular wallclock time will
jpayne@68 46 occur twice (once before the clocks are set back, once after). Both
jpayne@68 47 possibilities may be correct, unless further information is supplied.
jpayne@68 48
jpayne@68 49 See DstTzInfo.normalize() for more info
jpayne@68 50 '''
jpayne@68 51
jpayne@68 52
jpayne@68 53 class NonExistentTimeError(InvalidTimeError):
jpayne@68 54 '''Exception raised when attempting to create a wallclock time that
jpayne@68 55 cannot exist.
jpayne@68 56
jpayne@68 57 At the start of a DST transition period, the wallclock time jumps forward.
jpayne@68 58 The instants jumped over never occur.
jpayne@68 59 '''