Updated BMConfigParser getint to safeGetInt

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-09-27 19:25:09 +05:30
parent 9b00ef02b3
commit d15a58f78b
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A

View File

@ -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)