--- gmPG2.py.orig 2007-06-09 19:39:10.000000000 +0200 +++ gmPG2.py 2007-10-19 23:26:36.000000000 +0200 @@ -798,8 +798,12 @@ psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) psycopg2.extensions.register_type(psycopg2._psycopg.UNICODEARRAY) -# properly adapt *tuples* into (a, b, c, ...) in "... IN ..." queries -psycopg2.extensions.register_adapter(tuple, psycopg2.extras.SQL_IN) +try: + # properly adapt *tuples* into (a, b, c, ...) in "... IN ..." queries + psycopg2.extensions.register_adapter(tuple, psycopg2.extras.SQL_IN) +except AttributeError: + # only needed in psycopg2 < 0.2.6 + pass # do NOT adapt *lists* to "... IN (*) ..." syntax because we want # them adapted to "... ARRAY()..." so we can support PG arrays