From cdde1d54e4b96756f18c9bb2305e8a32216e1106 Mon Sep 17 00:00:00 2001 From: Alexandr Priezzhev Date: Tue, 19 Dec 2023 02:04:22 +0100 Subject: [PATCH] Fix when TZ environment var is not set --- freezegun/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freezegun/api.py b/freezegun/api.py index a5dd1bf6..b333b84a 100644 --- a/freezegun/api.py +++ b/freezegun/api.py @@ -41,7 +41,7 @@ real_datetime = datetime.datetime real_date_objects = [real_time, real_localtime, real_gmtime, real_monotonic, real_perf_counter, real_strftime, real_date, real_datetime] real_tzlocal = dateutil.tz.tzlocal -real_tz_env = os.environ["TZ"] +real_tz_env = os.environ["TZ"] if "TZ" in os.environ else '' if _TIME_NS_PRESENT: real_time_ns = time.time_ns