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()
|
||||
if config['use_proxy']:
|
||||
if config['proxyport'] != '':
|
||||
try:
|
||||
config['proxyport'] = int(config['proxyport'])
|
||||
except ValueError:
|
||||
dialogs.Error_dialog(_('Proxy Port must be a port number'))
|
||||
if not config['proxyport'].isdigit():
|
||||
dialogs.Error_dialog(_('Proxy port must be a port number'))
|
||||
return
|
||||
config['proxyport'] = int(config['proxyport'])
|
||||
|
||||
else:
|
||||
dialogs.Error_dialog(_('You must enter a proxy port to use proxy'))
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue