Commit aa0d4f2b authored by Vincent Pelletier's avatar Vincent Pelletier

Reduce try..except nesting.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1823 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 3d72feb8
......@@ -264,6 +264,8 @@ class MySQLDatabaseManager(DatabaseManager):
% (oid, before_tid))
try:
serial, compression, checksum, data = r[0]
except IndexError:
return None
r = q("""SELECT serial FROM obj
WHERE oid = %d AND serial >= %d
ORDER BY serial LIMIT 1""" \
......@@ -272,8 +274,6 @@ class MySQLDatabaseManager(DatabaseManager):
next_serial = r[0][0]
except IndexError:
next_serial = None
except IndexError:
return None
else:
# XXX I want to express "HAVING serial = MAX(serial)", but
# MySQL does not use an index for a HAVING clause!
......
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