File: 01_converters_boolean.patch

package info (click to toggle)
python-mysqldb 1.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 568 kB
  • sloc: python: 2,725; ansic: 2,659; makefile: 46
file content (18 lines) | stat: -rwxr-xr-x 397 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Description: take boolean into account at converters.py
Author: Jonas Meurer <jonas@freesources.org>
Last-Update: 2007-04-23

--- a/MySQLdb/converters.py
+++ b/MySQLdb/converters.py
@@ -163,5 +163,10 @@
 except ImportError:
     pass
 
-
+try:
+    from types import BooleanType
+    def Bool2Str(s, d): return str(int(s))
+    conversions[BooleanType] = Bool2Str
+except ImportError:
+    pass