Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: 4b37228823fecb73fe70dc009e696a7805b0833f authored by Ethan Furman on 08 December 2020, 22:29:02 UTC
[3.9] [Enum] reformat and add doc strings (GH-23705). (GH-23707)
Tip revision: 4b37228
__init__.py
__all__ = [
    "ZoneInfo",
    "reset_tzpath",
    "available_timezones",
    "TZPATH",
    "ZoneInfoNotFoundError",
    "InvalidTZPathWarning",
]

from . import _tzpath
from ._common import ZoneInfoNotFoundError

try:
    from _zoneinfo import ZoneInfo
except ImportError:  # pragma: nocover
    from ._zoneinfo import ZoneInfo

reset_tzpath = _tzpath.reset_tzpath
available_timezones = _tzpath.available_timezones
InvalidTZPathWarning = _tzpath.InvalidTZPathWarning


def __getattr__(name):
    if name == "TZPATH":
        return _tzpath.TZPATH
    else:
        raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


def __dir__():
    return sorted(list(globals()) + ["TZPATH"])
back to top