From afd488d33b6c7272f83c86fb1911e7cab060ad24 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Mon, 17 Nov 2014 22:33:25 -0800 Subject: [PATCH] catch exceptions from unknown timezones --- wakatime/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wakatime/__init__.py b/wakatime/__init__.py index fa9b7cb..a59f3df 100644 --- a/wakatime/__init__.py +++ b/wakatime/__init__.py @@ -287,7 +287,10 @@ def send_action(project=None, branch=None, stats=None, key=None, targetFile=None request.add_header('Authorization', auth) # add Olson timezone to request - tz = tzlocal.get_localzone() + try: + tz = tzlocal.get_localzone() + except: + tz = None if tz: request.add_header('TimeZone', u(tz.zone))