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,16 +264,16 @@ class MySQLDatabaseManager(DatabaseManager):
% (oid, before_tid))
try:
serial, compression, checksum, data = r[0]
r = q("""SELECT serial FROM obj
WHERE oid = %d AND serial >= %d
ORDER BY serial LIMIT 1""" \
% (oid, before_tid))
try:
next_serial = r[0][0]
except IndexError:
next_serial = None
except IndexError:
return None
r = q("""SELECT serial FROM obj
WHERE oid = %d AND serial >= %d
ORDER BY serial LIMIT 1""" \
% (oid, before_tid))
try:
next_serial = r[0][0]
except IndexError:
next_serial = 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