Browse Source

Fix bare-except pylint errors

v1.1.2-plural
Philipp Hörist 4 years ago committed by Philipp Hörist
parent
commit
5ff08236bb
  1. 2
      gajim/advanced_configuration_window.py
  2. 2
      gajim/common/jingle_rtp.py
  3. 2
      gajim/common/jingle_xtls.py
  4. 2
      gajim/common/modules/dataforms.py
  5. 2
      gajim/common/protocol/bytestream.py
  6. 4
      gajim/dev/ipython_view.py
  7. 2
      gajim/gtkgui_helpers.py
  8. 4
      gajim/gui_interface.py
  9. 2
      gajim/htmltextview.py
  10. 4
      gajim/plugins/gajimplugin.py
  11. 2
      plugins/dbus_plugin/plugin.py

2
gajim/advanced_configuration_window.py

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

2
gajim/common/jingle_rtp.py

@ -412,7 +412,7 @@ class JingleVideo(JingleRTPContent): @@ -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)

2
gajim/common/jingle_xtls.py

@ -85,7 +85,7 @@ def load_cert_file(cert_path, cert_store=None): @@ -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

2
gajim/common/modules/dataforms.py

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

2
gajim/common/protocol/bytestream.py

@ -813,7 +813,7 @@ class ConnectionIBBytestream(ConnectionBytestream): @@ -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

4
gajim/dev/ipython_view.py

@ -193,7 +193,7 @@ class IterableIPShell: @@ -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: @@ -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)

2
gajim/gtkgui_helpers.py

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

4
gajim/gui_interface.py

@ -48,7 +48,7 @@ import OpenSSL @@ -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: @@ -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()

2
gajim/htmltextview.py

@ -283,7 +283,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler): @@ -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:

4
gajim/plugins/gajimplugin.py

@ -258,7 +258,7 @@ class GajimPluginConfig(): @@ -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(): @@ -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'))

2
plugins/dbus_plugin/plugin.py

@ -328,7 +328,7 @@ if dbus_support.supported: @@ -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)

Loading…
Cancel
Save