Changeset 591


Ignore:
Timestamp:
Nov 22, 2015, 12:01:13 AM (4 years ago)
Author:
cito
Message:

Some more adaptations for Python 3

Location:
trunk/module
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/module/TEST_PyGreSQL_classic_dbwrapper.py

    r580 r591  
    759759                oid = data[oid_table]
    760760                self.assertIsInstance(oid, int)
    761                 data = dict(item for item in data.iteritems()
     761                data = dict(item for item in data.items()
    762762                    if item[0] in expect)
    763763                ts = expect.get('ts')
     
    778778                    'select oid,* from "%s"' % table).dictresult()[0]
    779779                self.assertEqual(data['oid'], oid)
    780                 data = dict(item for item in data.iteritems()
     780                data = dict(item for item in data.items()
    781781                    if item[0] in expect)
    782782                self.assertEqual(data, expect)
  • trunk/module/pg.py

    r590 r591  
    2929# supporting documentation.
    3030
    31 import sys
    32 if sys.version_info[0] == 3:
    33     class basestring(str): pass
    34 
    3531from _pg import *
    3632
     
    4036from decimal import Decimal
    4137from collections import namedtuple
     38
     39try:
     40    basestring
     41except NameError:  # Python >= 3.0
     42    basestring = (str, bytes)
    4243
    4344set_decimal(Decimal)
Note: See TracChangeset for help on using the changeset viewer.