mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-15 12:14:51 +08:00
a7fba2ee1b
As Brazil does not have Daylight Saving Time anymore as decided by it's government, pytz needed to be updated to have the new data about the country timezones. And as some in pytz calls in bazarr used tzlocal functions, that one needed also to be updated. Works fine now, tested on Brazil - Timezone America/Sao_Paulo This commit fixes #641
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.
|
|
'''
|