prevent traceback when a wrong timezone arrive.

This commit is contained in:
Yann Leboulanger 2016-10-16 22:40:41 +02:00
parent 9db1ba1d05
commit c841c7973d
1 changed files with 5 additions and 1 deletions

View File

@ -206,7 +206,11 @@ class TimeResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
tzo = qp.getTag('tzo').getData() tzo = qp.getTag('tzo').getData()
if tzo.lower() == 'z': if tzo.lower() == 'z':
tzo = '0:0' tzo = '0:0'
tzoh, tzom = tzo.split(':') try:
tzoh, tzom = tzo.split(':')
except Exception, e:
# wrong tzo
return
utc_time = qp.getTag('utc').getData() utc_time = qp.getTag('utc').getData()
ZERO = datetime.timedelta(0) ZERO = datetime.timedelta(0)
class UTC(datetime.tzinfo): class UTC(datetime.tzinfo):