Fix bare-except pylint errors

This commit is contained in:
Philipp Hörist 2018-09-16 23:45:01 +02:00 committed by Philipp Hörist
parent 1c7f347a08
commit 5ff08236bb
11 changed files with 14 additions and 14 deletions

View File

@ -306,7 +306,7 @@ class AdvancedConfigurationWindow:
else:
try:
value = str(option)
except:
except Exception:
value = option
self.model.append(parent, [name, value, type_])

View File

@ -412,7 +412,7 @@ class JingleVideo(JingleRTPContent):
framerate = ''
try:
w, h = app.config.get('video_size').split('x')
except:
except Exception:
w = h = None
if w and h:
video_size = 'video/x-raw,width=%s,height=%s ! ' % (w, h)

View File

@ -85,7 +85,7 @@ def load_cert_file(cert_path, cert_store=None):
except OpenSSL.crypto.Error as exception_obj:
log.warning('Unable to load a certificate from file %s: %s',
cert_path, exception_obj.args[0][0][2])
except:
except Exception:
log.warning('Unknown error while loading certificate from file '
'%s', cert_path)
begin = -1

View File

@ -741,7 +741,7 @@ class MultipleDataForm(DataForm):
# def reported(self, record):
# try:
# self.delChild('reported')
# except:
# except Exception:
# pass
#
# record.setName('reported')

View File

@ -813,7 +813,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
file_props = FilesProp.getFilePropByTransportSid(self.name, sid)
try:
blocksize = int(blocksize)
except:
except Exception:
err = nbxmpp.ERR_BAD_REQUEST
if not sid or not blocksize:
err = nbxmpp.ERR_BAD_REQUEST

View File

@ -193,7 +193,7 @@ class IterableIPShell:
if self.iter_more:
try:
self.prompt = self.generatePrompt(True)
except:
except Exception:
self.IP.showtraceback()
if self.IP.autoindent:
self.IP.rl_do_indent = True
@ -203,7 +203,7 @@ class IterableIPShell:
except KeyboardInterrupt:
self.IP.write('\nKeyboardInterrupt\n')
self.IP.input_splitter.reset()
except:
except Exception:
self.IP.showtraceback()
else:
self.IP.input_splitter.push(line)

View File

@ -37,7 +37,7 @@ import xml.etree.ElementTree as ET
try:
from PIL import Image
except:
except Exception:
pass
from io import BytesIO

View File

@ -48,7 +48,7 @@ import OpenSSL
try:
from PIL import Image
except:
except Exception:
pass
from gajim.common import app
@ -934,7 +934,7 @@ class Interface:
h = Hashes2()
try:
file_ = open(file_props.file_name, 'rb')
except:
except Exception:
return
hash_ = h.calculateHash(file_props.algo, file_)
file_.close()

View File

@ -283,7 +283,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
def get_val(min_val=minl, max_val=maxl):
try:
val = float(value[:-2])
except:
except Exception:
log.warning('Unable to parse length value "%s"', value)
return None
if val > 0:

View File

@ -258,7 +258,7 @@ class GajimPluginConfig():
try:
self.data = pickle.load(fd)
fd.close()
except:
except Exception:
fd.close()
try:
import shelve
@ -269,7 +269,7 @@ class GajimPluginConfig():
raise GajimPluginException
s.close()
self.save()
except:
except Exception:
log.warning('%s plugin config file not readable. Saving it as '
'%s and creating a new one' % (self.plugin.short_name,
self.FILE_PATH.decode(locale.getpreferredencoding()) + '.bak'))

View File

@ -328,7 +328,7 @@ if dbus_support.supported:
jid = self._get_real_jid(jid, account)
try:
jid = helpers.parse_jid(jid)
except:
except Exception:
# Jid is not conform, ignore it
return DBUS_BOOLEAN(False)