Changeset 359 for trunk/module/pg.py


Ignore:
Timestamp:
Nov 21, 2008, 8:10:51 AM (11 years ago)
Author:
cito
Message:

Avoid bare excepts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/pg.py

    r358 r359  
    66# Improved by Christoph Zwerschke
    77#
    8 # $Id: pg.py,v 1.60 2008-11-21 13:00:21 cito Exp $
     8# $Id: pg.py,v 1.61 2008-11-21 13:10:51 cito Exp $
    99#
    1010
     
    222222        # There is no such shared library function.
    223223        if self._closeable:
     224            db = connect(*self._args[0], **self._args[1])
    224225            if self.db:
    225226                self.db.close()
    226             try:
    227                 self.db = connect(*self._args[0], **self._args[1])
    228             except:
    229                 self.db = None
    230                 raise
     227            self.db = db
    231228
    232229    def query(self, qstr):
     
    503500        try:
    504501            return self.get(qcl, a, 'oid')
    505         except:
     502        except Exception:
    506503            return None
    507504
     
    543540            try:
    544541                pk = self.pkey(qcl)
    545             except:
     542            except Exception:
    546543                raise ProgrammingError(
    547544                    'Update needs primary key or oid as %s' % foid)
Note: See TracChangeset for help on using the changeset viewer.