cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 22 Jun 2011 18:24:56 +0200
branchstable
changeset 7551 2d4ba5b984dc
parent 7550 183a61d1bab9
child 7555 c3bf459268d7
cleanup
hooks/syncschema.py
server/sources/native.py
--- a/hooks/syncschema.py	Wed Jun 22 18:23:44 2011 +0200
+++ b/hooks/syncschema.py	Wed Jun 22 18:24:56 2011 +0200
@@ -263,7 +263,7 @@
         for rtype in (META_RTYPES - VIRTUAL_RTYPES):
             try:
                 rschema = schema[rtype]
-            except:
+            except KeyError:
                 if rtype == 'cw_source':
                     continue # XXX 3.10 migration
                 raise
--- a/server/sources/native.py	Wed Jun 22 18:23:44 2011 +0200
+++ b/server/sources/native.py	Wed Jun 22 18:24:56 2011 +0200
@@ -677,7 +677,7 @@
             for subject, object in subj_obj_list:
                 self._record_tx_action(session, 'tx_relation_actions', 'A',
                                        eid_from=subject, rtype=rtype, eid_to=object)
-                
+
     def _add_relations(self, session, rtype, subj_obj_list, inlined=False):
         """add a relation to the source"""
         sql = []
@@ -747,7 +747,7 @@
                     session.pool.connection(self.uri).rollback()
                     if self.repo.config.mode != 'test':
                         self.critical('transaction has been rollbacked')
-                except:
+                except Exception, ex:
                     pass
             if ex.__class__.__name__ == 'IntegrityError':
                 # need string comparison because of various backends
@@ -1605,7 +1605,7 @@
     * a list of rows (as tuples with one element per column)
 
     Tables are saved in chunks in different files in order to prevent
-    a too high memory consumption. 
+    a too high memory consumption.
     """
     def __init__(self, source):
         """