From d15a58f78b25c327d425d6ff5e7c58642ce32c5a Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Mon, 27 Sep 2021 19:25:09 +0530 Subject: [PATCH] Updated BMConfigParser getint to safeGetInt --- src/upnp.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/upnp.py b/src/upnp.py index 18e64128..c6db487b 100644 --- a/src/upnp.py +++ b/src/upnp.py @@ -207,10 +207,7 @@ class uPnPThread(StoppableThread): def __init__(self): super(uPnPThread, self).__init__(name="uPnPThread") - try: - self.extPort = BMConfigParser().getint('bitmessagesettings', 'extport') - except: # noqa:E722 - self.extPort = None + self.extPort = BMConfigParser().safeGetInt('bitmessagesettings', 'extport', default=None) self.localIP = self.getLocalIP() self.routers = [] self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)