X-Git-Url: http://average.org/gitweb/?a=blobdiff_plain;f=gps303%2Ftermconfig.py;h=723e8f62766ef542dbdb337ae015c66203ff1b9c;hb=18eda7307e92eeee6a9e2fdd2e810f98d25df654;hp=953e6aec75f67ae380732d7f80dcfcc4cfa845ed;hpb=428cb6396a46338d3681fca111f983cd5f8876d5;p=loctrkd.git diff --git a/gps303/termconfig.py b/gps303/termconfig.py index 953e6ae..723e8f6 100644 --- a/gps303/termconfig.py +++ b/gps303/termconfig.py @@ -44,8 +44,10 @@ def runserver(conf: ConfigParser) -> None: ) if zmsg.imei is not None and conf.has_section(zmsg.imei): termconfig = common.normconf(conf[zmsg.imei]) - else: + elif conf.has_section("termconfig"): termconfig = common.normconf(conf["termconfig"]) + else: + termconfig = {} kwargs = {} if isinstance(msg, STATUS): kwargs = { @@ -74,7 +76,9 @@ def runserver(conf: ConfigParser) -> None: zpush.send(resp.packed) except KeyboardInterrupt: - pass + zsub.close() + zpush.close() + zctx.destroy() # type: ignore if __name__.endswith("__main__"):