1
0

fix more bare excepts

This commit is contained in:
Bryan Stitt
2013-11-10 12:30:57 -08:00
parent 24cabcbee9
commit 6cd4ed486a
21 changed files with 67 additions and 67 deletions

View File

@@ -42,7 +42,7 @@ class Plugin(BasePlugin):
if re.match('^(|([\w\-\.]+)@)((\w[\w\-]+\.)+[\w\-]+)$', r):
try:
to_address = self.get_alias(r, True, self.gui.show_message, self.gui.question)
except:
except Exception:
return
if to_address:
s = r + ' <' + to_address + '>'
@@ -103,7 +103,7 @@ class Plugin(BasePlugin):
return ''
try:
lines = urllib.urlopen(url).readlines()
except:
except Exception:
return ''
# line 0
@@ -147,7 +147,7 @@ class Plugin(BasePlugin):
try:
EC_KEY.verify_message(signing_address, signature, url )
self.receipt = (signing_address, signature, url)
except:
except Exception:
show_message('Warning: the URI contains a bad signature.\nThe identity of the recipient cannot be verified.')
address = amount = label = identity = message = ''

View File

@@ -34,14 +34,14 @@ class Exchanger(threading.Thread):
try:
connection = httplib.HTTPConnection('blockchain.info')
connection.request("GET", "/ticker")
except:
except Exception:
return
response = connection.getresponse()
if response.reason == httplib.responses[httplib.NOT_FOUND]:
return
try:
response = json.loads(response.read())
except:
except Exception:
return
quote_currencies = {}
try:
@@ -122,12 +122,12 @@ class Plugin(BasePlugin):
def set_currencies(combo):
try:
combo.clear()
except:
except Exception:
return
combo.addItems(self.currencies)
try:
index = self.currencies.index(self.config.get('currency', "EUR"))
except:
except Exception:
index = 0
combo.setCurrentIndex(index)

View File

@@ -7,7 +7,7 @@ import json
from urlparse import urlparse, parse_qs
try:
import PyQt4
except:
except Exception:
sys.exit("Error: Could not import PyQt4 on Linux systems, you may try 'sudo apt-get install python-qt4'")
from PyQt4.QtGui import *

View File

@@ -165,7 +165,7 @@ class Plugin(BasePlugin):
def update_receive_item(self, address, item):
try:
amount, currency = self.requested_amounts.get(address, (None, None))
except:
except Exception:
print "cannot get requested amount", address, self.requested_amounts.get(address)
amount, currency = None, None
self.requested_amounts.pop(address)
@@ -183,7 +183,7 @@ class Plugin(BasePlugin):
label = self.wallet.labels.get(address)
try:
amount, currency = self.requested_amounts.get(address, (None, None))
except:
except Exception:
amount, currency = None, None
self.qr_window.set_content( address, label, amount, currency )
@@ -197,7 +197,7 @@ class Plugin(BasePlugin):
try:
seq = self.wallet.get_address_index(address)
index = seq[1][1]
except:
except Exception:
print "cannot get index"
return

View File

@@ -76,7 +76,7 @@ class Plugin(BasePlugin):
while True:
try:
proc.process_one()
except:
except Exception:
# User closed the preview window
return {}
@@ -99,12 +99,12 @@ class Plugin(BasePlugin):
try:
amount = self.gui.main_window.read_amount(unicode( self.gui.main_window.amount_e.text()))
except:
except Exception:
QMessageBox.warning(self.gui.main_window, _('Error'), _('Invalid Amount'), _('OK'))
return
try:
fee = self.gui.main_window.read_amount(unicode( self.gui.main_window.fee_e.text()))
except:
except Exception:
QMessageBox.warning(self.gui.main_window, _('Error'), _('Invalid Fee'), _('OK'))
return