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