Project

General

Profile

« Previous | Next » 

Revision 2164

sql.py: Wrapped calls to get_cur_query() that are used as strings in str(), because get_cur_query() can return None

View differences:

lib/sql.py
21 21
    elif hasattr(cur, '_last_executed'): return cur._last_executed
22 22
    else: return None
23 23

  
24
def _add_cursor_info(e, cur): exc.add_msg(e, 'query: '+get_cur_query(cur))
24
def _add_cursor_info(e, cur): exc.add_msg(e, 'query: '+str(get_cur_query(cur)))
25 25

  
26 26
class DbException(exc.ExceptionWithCause):
27 27
    def __init__(self, msg, cause=None, cur=None):
......
258 258
                elif cacheable: cache_status = 'Cache miss'
259 259
                else: cache_status = 'Non-cacheable'
260 260
                self.log_debug(cache_status+': '
261
                    +strings.one_line(get_cur_query(cur)))
261
                    +strings.one_line(str(get_cur_query(cur))))
262 262
        
263 263
        return cur
264 264
    

Also available in: Unified diff