File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 44import os
55import re
66import sys
7+ import warnings
78
89from contextlib import contextmanager
910from typing import Iterator
1011from typing import cast
1112
1213from pendulum .tz .exceptions import InvalidTimezone
14+ from pendulum .tz .timezone import UTC
1315from pendulum .tz .timezone import FixedTimezone
1416from pendulum .tz .timezone import Timezone
1517
@@ -239,7 +241,11 @@ def _get_unix_timezone(_root: str = "/") -> Timezone:
239241 with open (tzpath , "rb" ) as f :
240242 return Timezone .from_file (f )
241243
242- raise RuntimeError ("Unable to find any timezone configuration" )
244+ warnings .warn (
245+ "Unable not find any timezone configuration, defaulting to UTC." , stacklevel = 1
246+ )
247+
248+ return UTC
243249
244250
245251def _tz_from_env (tzenv : str ) -> Timezone :
You can’t perform that action at this time.
0 commit comments