From cbf2dee7c7a0b71759c5aebad2d974030ac84b88 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 11 Dec 2008 23:28:01 +0100 Subject: [PATCH] [FIX] The second parameter of the map function must support iteration lp bug: https://launchpad.net/bugs/307284 fixed bzr revid: stephane@tinyerp.com-20081211222801-343rhnfmr21fw7le --- bin/sql_db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/sql_db.py b/bin/sql_db.py index 4286a98da2f..cf9aa75ac4e 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -69,8 +69,11 @@ class Cursor(object): self.dbname = pool.dbname def execute(self, query, params=None): - if not params: + if params is None: params=() + if not isinstance(params, (tuple, list)): + params = (params,) + def base_string(s): if isinstance(s, unicode): return s.encode('utf-8')