Changeset 575


Ignore:
Timestamp:
Nov 21, 2015, 12:26:50 PM (4 years ago)
Author:
cito
Message:

Don't use eval() if not necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/TEST_PyGreSQL_classic_connection.py

    r574 r575  
    8080        attributes = '''db error host options port
    8181            protocol_version server_version status tty user'''.split()
    82         connection_attributes = [a for a in dir(self.connection)
     82        connection = self.connection
     83        connection_attributes = [a for a in dir(connection)
    8384            if not a.startswith('__')
    84             and not callable(eval("self.connection." + a))]
     85            and not callable(getattr(connection, a))]
    8586        self.assertEqual(attributes, connection_attributes)
    8687
     
    9192            inserttable locreate loimport parameter putline query reset
    9293            set_notice_receiver source transaction'''.split()
    93         connection_methods = [a for a in dir(self.connection)
     94        connection = self.connection
     95        connection_methods = [a for a in dir(connection)
    9496            if not a.startswith('__')
    95             and callable(eval("self.connection." + a))]
     97            and callable(getattr(connection, a))]
    9698        self.assertEqual(methods, connection_methods)
    9799
Note: See TracChangeset for help on using the changeset viewer.