aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/packages/tzlocal/unix.py
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/packages/tzlocal/unix.py')
-rw-r--r--nikola/packages/tzlocal/unix.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nikola/packages/tzlocal/unix.py b/nikola/packages/tzlocal/unix.py
index 086ab7c..ce3e852 100644
--- a/nikola/packages/tzlocal/unix.py
+++ b/nikola/packages/tzlocal/unix.py
@@ -116,8 +116,9 @@ def _get_localzone(_root="/"):
while start != 0:
tzpath = tzpath[start:]
try:
- dateutil.tz.gettz(tzpath)
- return tzpath
+ tested_tz = dateutil.tz.gettz(tzpath)
+ if tested_tz:
+ return tzpath
except Exception:
pass
start = tzpath.find("/") + 1