commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue-common/src/datasources/drivers/DBSIG2 Driv...


From: Jan Ischebeck
Subject: gnue-common/src/datasources/drivers/DBSIG2 Driv...
Date: Sun, 12 Oct 2003 15:43:58 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-common
Branch:         
Changes by:     Jan Ischebeck <address@hidden>  03/10/12 15:43:57

Modified files:
        src/datasources/drivers/DBSIG2: Driver.py 

Log message:
        fix BooleanType, by hasattr check. Needed for python2.2 backward compat.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/datasources/drivers/DBSIG2/Driver.py.diff?tr1=1.76&tr2=1.77&r1=text&r2=text

Patches:
Index: gnue-common/src/datasources/drivers/DBSIG2/Driver.py
diff -c gnue-common/src/datasources/drivers/DBSIG2/Driver.py:1.76 
gnue-common/src/datasources/drivers/DBSIG2/Driver.py:1.77
*** gnue-common/src/datasources/drivers/DBSIG2/Driver.py:1.76   Thu Oct  9 
17:27:48 2003
--- gnue-common/src/datasources/drivers/DBSIG2/Driver.py        Sun Oct 12 
15:43:57 2003
***************
*** 250,261 ****
        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)
  
--- 250,255 ----
***************
*** 282,287 ****
--- 276,288 ----
                                         "'",
                                         "%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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]