Changeset 556


Ignore:
Timestamp:
Nov 20, 2015, 10:13:42 AM (4 years ago)
Author:
cito
Message:

Use the modern except .. as syntax in the trunk

Location:
trunk/module
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/TEST_PyGreSQL_classic_connection.py

    r553 r556  
    5454        try:
    5555            connection = connect()
    56         except pg.Error, error:
     56        except pg.Error as error:
    5757            self.fail('Cannot connect to database %s:\n%s' % (dbname, error))
    5858        try:
     
    197197            try:
    198198                self.connection.query('select pg_sleep(5)').getresult()
    199             except pg.ProgrammingError, error:
     199            except pg.ProgrammingError as error:
    200200                errors.append(str(error))
    201201
  • trunk/module/TEST_PyGreSQL_classic_dbwrapper.py

    r553 r556  
    215215        try:
    216216            self.db.query("select 1/0")
    217         except pg.ProgrammingError, error:
     217        except pg.ProgrammingError as error:
    218218            self.assertEqual(error.sqlstate, '22012')
    219219
     
    480480        try:
    481481            self.db.query("select 1/0")
    482         except pg.ProgrammingError, error:
     482        except pg.ProgrammingError as error:
    483483            self.assertEqual(error.sqlstate, '22012')
    484484
     
    969969                query("insert into test_table values (4)")
    970970                raise ValueError('test transaction should rollback')
    971         except ValueError, error:
     971        except ValueError as error:
    972972            self.assertEqual(str(error), 'test transaction should rollback')
    973973        with self.db:
     
    977977                query("insert into test_table values (6)")
    978978                query("insert into test_table values (-1)")
    979         except pg.ProgrammingError, error:
     979        except pg.ProgrammingError as error:
    980980            self.assertTrue('check' in str(error))
    981981        with self.db:
Note: See TracChangeset for help on using the changeset viewer.