Skip to content

Commit

Permalink
Update sbs1.py
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-iqt committed Mar 22, 2021
1 parent b0a8263 commit 152a5df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adsb-mqtt/sbs1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import *
from datetime import datetime
import logging
import re
try:
import dateutil.parser
except ImportError as e:
Expand Down Expand Up @@ -124,7 +125,8 @@ def __parseInt(array: List, index: int):
"""Parse int at given index in array
Return int value or None if index is out of bounds or type casting failed"""
try:
return int(array[index])
numbers = re.findall('[0-9]+', array[index])[0]
return int(numbers)
except ValueError as e:
return None
except TypeError as e:
Expand Down

0 comments on commit 152a5df

Please sign in to comment.