Commit 7bb6f8b2 authored by Philipp Hörist's avatar Philipp Hörist

Fix bare-except pylint errors

parent b8bbcf2b
......@@ -306,7 +306,7 @@ class AdvancedConfigurationWindow:
else:
try:
value = str(option)
except:
except Exception:
value = option
self.model.append(parent, [name, value, type_])
......
......@@ -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)
......
......@@ -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
......
......@@ -741,7 +741,7 @@ class MultipleDataForm(DataForm):
# def reported(self, record):
# try:
# self.delChild('reported')
# except:
# except Exception:
# pass
#
# record.setName('reported')
......
......@@ -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
......
......@@ -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)
......
......@@ -37,7 +37,7 @@ import xml.etree.ElementTree as ET
try:
from PIL import Image
except:
except Exception:
pass
from io import BytesIO
......
......@@ -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()
......
......@@ -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:
......
......@@ -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'))
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment