[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVSROOT: /cvsroot/gnue
From: |
Jan Ischebeck |
Subject: |
CVSROOT: /cvsroot/gnue |
Date: |
Sun, 12 Oct 2003 15:47:16 -0400 |
Module name: gnue-common
Branch: datasource-cleanup
Changes by: Jan Ischebeck <address@hidden> 03/10/12 15:47:15
Reply-to: address@hidden
CVSROOT: /cvsroot/gnue
Module name: gnue-common
Branch: datasource-cleanup
Changes by: Jan Ischebeck <address@hidden> 03/10/12 15:47:15
Modified files:
src/datasources/drivers/DBSIG2: DataObject.py
Log message:
check if types has booleantype before testing on booleantype (python <
2.3 fix)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py.diff?only_with_tag=datasource-cleanup&tr1=1.1.2.2&tr2=1.1.2.3&r1=text&r2=text
Patches:
Index: gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
diff -c gnue-common/src/datasources/drivers/DBSIG2/DataObject.py:1.1.2.2
gnue-common/src/datasources/drivers/DBSIG2/DataObject.py:1.1.2.3
*** gnue-common/src/datasources/drivers/DBSIG2/DataObject.py:1.1.2.2 Fri Oct
10 08:18:49 2003
--- gnue-common/src/datasources/drivers/DBSIG2/DataObject.py Sun Oct 12
15:47:15 2003
***************
*** 118,129 ****
if value == None:
return "NULL"
- elif type(value) == types.BooleanType:
- if value:
- return 'TRUE'
- else:
- return 'FALSE'
-
elif type(value) == types.IntType:
return str(value)
--- 118,123 ----
***************
*** 150,155 ****
--- 144,156 ----
"'",
"%s'" % self._escapeSingleQuote)
+ # TODO: make this test faster, possibly move type check to GTypecast
+ elif hasattr(types,'BooleanType') and typestype(value) ==
types.BooleanType:
+ if value:
+ return 'TRUE'
+ else:
+ return 'FALSE'
+
else:
err = _("Object of unknown type (%s) passed to DBSIG2 based
dbdriver.") % type(value)
# FIXME: raise an error instead of just printing a warning, after
some transition time