Commit 844fefc2 authored by Romain Courteaud's avatar Romain Courteaud

Remove except used without exception name in checkConsistency.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3780 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6781c652
...@@ -579,19 +579,21 @@ be a problem).""" ...@@ -579,19 +579,21 @@ be a problem)."""
""" """
Check the consistency of this object, then Check the consistency of this object, then
check recursively the consistency of every sub object. check recursively the consistency of every sub object.
""" """
error_list = [] error_list = []
# Fix BTree # Fix BTree
if fixit: if fixit:
btree_ok = self._cleanup() btree_ok = self._cleanup()
if not btree_ok: if not btree_ok:
get_transaction().commit() # We must commit if we want to keep on recursing # We must commit if we want to keep on recursing
error_list += [(self.getRelativeUrl(), 'BTree Inconsistency', 199, '(fixed)')] get_transaction().commit()
error_list += [(self.getRelativeUrl(), 'BTree Inconsistency',
199, '(fixed)')]
# Call superclass # Call superclass
error_list += Base.checkConsistency(self, fixit=fixit) error_list += Base.checkConsistency(self, fixit=fixit)
if fixit: get_transaction().commit() # We must commit before listing folder contents # We must commit before listing folder contents
# in case we erased some data # in case we erased some data
if fixit: get_transaction().commit()
# Then check the consistency on all sub objects # Then check the consistency on all sub objects
for object in self.contentValues(): for object in self.contentValues():
if fixit: if fixit:
...@@ -602,14 +604,12 @@ be a problem).""" ...@@ -602,14 +604,12 @@ be a problem)."""
error_list += extra_errors error_list += extra_errors
# Commit after each subobject # Commit after each subobject
#if fixit: #if fixit:
try: # XXX it is bad to use except without exception name !
# try:
get_transaction().commit() get_transaction().commit()
except: # except:
LOG("Folder WARNING",0, # LOG("Folder WARNING",0,
"Could not commit checkConsistency transaction for object %s" % object.getRelativeUrl()) # "Could not commit checkConsistency transaction for object %s" % object.getRelativeUrl())
# We should also return an error if any # We should also return an error if any
return error_list return error_list
......
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