Commit 4e5ad574 authored by Jérome Perrin's avatar Jérome Perrin

*: adjust what 2to3's except fixer left as TODO

parent 646b86bc
...@@ -192,9 +192,8 @@ CREATE TABLE %s ( ...@@ -192,9 +192,8 @@ CREATE TABLE %s (
db.query("SET @uid := %s" % getrandbits(UID_SAFE_BITSIZE)) db.query("SET @uid := %s" % getrandbits(UID_SAFE_BITSIZE))
try: try:
db.query(self._insert_template % (self.sql_table, values)) db.query(self._insert_template % (self.sql_table, values))
except MySQLdb.IntegrityError as xxx_todo_changeme: except MySQLdb.IntegrityError as e:
(code, _) = xxx_todo_changeme.args if e.args[0] != DUP_ENTRY:
if code != DUP_ENTRY:
raise raise
reset_uid = True reset_uid = True
else: else:
......
...@@ -93,9 +93,8 @@ CREATE TABLE %s ( ...@@ -93,9 +93,8 @@ CREATE TABLE %s (
db.query("SET @uid := %s" % getrandbits(UID_SAFE_BITSIZE)) db.query("SET @uid := %s" % getrandbits(UID_SAFE_BITSIZE))
try: try:
db.query(self._insert_template % (self.sql_table, values)) db.query(self._insert_template % (self.sql_table, values))
except MySQLdb.IntegrityError as xxx_todo_changeme: except MySQLdb.IntegrityError as e:
(code, _) = xxx_todo_changeme.args if e.args[0] != DUP_ENTRY:
if code != DUP_ENTRY:
raise raise
reset_uid = True reset_uid = True
else: else:
......
...@@ -1420,9 +1420,8 @@ class SimulationTool(BaseTool): ...@@ -1420,9 +1420,8 @@ class SimulationTool(BaseTool):
inventory_cache_kw['date'] = to_date inventory_cache_kw['date'] = to_date
try: try:
cached_sql_result = Resource_zGetInventoryCacheResult(**inventory_cache_kw) cached_sql_result = Resource_zGetInventoryCacheResult(**inventory_cache_kw)
except ProgrammingError as xxx_todo_changeme: except ProgrammingError as e:
(code, _) = xxx_todo_changeme.args if e.args[0] != NO_SUCH_TABLE:
if code != NO_SUCH_TABLE:
raise raise
# First use of the optimisation, we need to create the table # First use of the optimisation, we need to create the table
LOG("SimulationTool._getCachedInventoryList", INFO, LOG("SimulationTool._getCachedInventoryList", INFO,
......
...@@ -147,15 +147,15 @@ class Checker(URLOpener): ...@@ -147,15 +147,15 @@ class Checker(URLOpener):
while thread.isAlive(): while thread.isAlive():
sleep(0.5) sleep(0.5)
print "Connection to %s went fine" % url print "Connection to %s went fine" % url
except IOError as xxx_todo_changeme: except IOError as e:
(errno, strerror) = xxx_todo_changeme.args (errno, strerror) = e.args
print "Can't connect to %s because of I/O error(%s): %s" % (url, errno, strerror) print "Can't connect to %s because of I/O error(%s): %s" % (url, errno, strerror)
def SearchUrl(self, url=None): def SearchUrl(self, url=None):
try: try:
conn = self.open_http(url) conn = self.open_http(url)
except IOError as xxx_todo_changeme1: except IOError as e:
(errno, strerror) = xxx_todo_changeme1.args (errno, strerror) = e.args
print "Can't connect to %s because of I/O error(%s): %s" % (url, errno, strerror) print "Can't connect to %s because of I/O error(%s): %s" % (url, errno, strerror)
......
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