Update of /cvsroot/pypgsql/pypgsql/pyPgSQL/libpq
In directory usw-pr-cvs1:/tmp/cvs-serv17409/pyPgSQL/libpq
Modified Files:
__init__.py
Log Message:
01OCT2002 gh Register libpq.PgInt8 with copy_reg only if available.
Index: __init__.py
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/pyPgSQL/libpq/__init__.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** __init__.py 13 Oct 2001 20:58:22 -0000 1.1
--- __init__.py 2 Oct 2002 04:11:54 -0000 1.2
***************
*** 24,27 ****
--- 24,29 ----
from libpq import __version__
+ HAVE_LONG_LONG_SUPPORT = dir().count('PgInt8') == 1
+
#-----------------------------------------------------------------------+
# Add support to pickle the following pyPgSQL opbjects: |
***************
*** 70,76 ****
copy_reg.pickle(PgInt2Type, pickle_PgInt2, _I2)
! def pickle_PgInt8(value):
! return _I8, (str(value),)
! copy_reg.pickle(PgInt8Type, pickle_PgInt8, _I8)
def pickle_PgLargeObject(value):
--- 72,79 ----
copy_reg.pickle(PgInt2Type, pickle_PgInt2, _I2)
! if HAVE_LONG_LONG_SUPPORT:
! def pickle_PgInt8(value):
! return _I8, (str(value),)
! copy_reg.pickle(PgInt8Type, pickle_PgInt8, _I8)
def pickle_PgLargeObject(value):
|