use isdigit() instead of excepting ValueError
This commit is contained in:
parent
9152f128e7
commit
f4d8ff0944
|
@ -1085,11 +1085,11 @@ class Account_modification_window:
|
||||||
config['proxypass'] = self.xml.get_widget('proxypass_entry').get_text()
|
config['proxypass'] = self.xml.get_widget('proxypass_entry').get_text()
|
||||||
if config['use_proxy']:
|
if config['use_proxy']:
|
||||||
if config['proxyport'] != '':
|
if config['proxyport'] != '':
|
||||||
try:
|
if not config['proxyport'].isdigit():
|
||||||
config['proxyport'] = int(config['proxyport'])
|
dialogs.Error_dialog(_('Proxy port must be a port number'))
|
||||||
except ValueError:
|
|
||||||
dialogs.Error_dialog(_('Proxy Port must be a port number'))
|
|
||||||
return
|
return
|
||||||
|
config['proxyport'] = int(config['proxyport'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
dialogs.Error_dialog(_('You must enter a proxy port to use proxy'))
|
dialogs.Error_dialog(_('You must enter a proxy port to use proxy'))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue