Changeset 2031
- Timestamp:
- 01/19/05 09:48:17 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/pgstorage.py
r1717 r2031 22 22 # 23 23 # $Log$ 24 # Revision 1.38 2005/01/19 08:48:17 jalet 25 # Fix exception's name wrt newer versions of PygreSQL 26 # 24 27 # Revision 1.37 2004/09/14 22:29:12 jalet 25 28 # First version of dumpykota. Works fine but only with PostgreSQL backend … … 159 162 # TODO : to translate or not to translate ? 160 163 raise PyKotaStorageError, "This python version (%s) doesn't seem to have the PygreSQL module installed correctly." % sys.version.split()[0] 164 else : 165 try : 166 PGError = pg.Error 167 except AttributeError : 168 PGError = pg.error 161 169 162 170 class Storage(BaseStorage, SQLStorage) : … … 172 180 try : 173 181 self.database = pg.connect(host=host, port=port, dbname=dbname, user=user, passwd=passwd) 174 except pg.error, msg :182 except PGError, msg : 175 183 raise PyKotaStorageError, msg 176 184 else : … … 208 216 self.tool.logdebug("QUERY : %s" % query) 209 217 result = self.database.query(query) 210 except pg.error, msg :218 except PGError, msg : 211 219 raise PyKotaStorageError, msg 212 220 else : … … 227 235 self.tool.logdebug("QUERY : %s" % query) 228 236 result = self.database.query(query) 229 except pg.error, msg :237 except PGError, msg : 230 238 raise PyKotaStorageError, msg 231 239 else :