From c841c7973d02201ed53604bc3f01a4566c209eae Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 16 Oct 2016 22:40:41 +0200 Subject: [PATCH] prevent traceback when a wrong timezone arrive. --- src/common/connection_handlers_events.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index 3851cdfe5..9dbee20a0 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -206,7 +206,11 @@ class TimeResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): tzo = qp.getTag('tzo').getData() if tzo.lower() == 'z': tzo = '0:0' - tzoh, tzom = tzo.split(':') + try: + tzoh, tzom = tzo.split(':') + except Exception, e: + # wrong tzo + return utc_time = qp.getTag('utc').getData() ZERO = datetime.timedelta(0) class UTC(datetime.tzinfo):