def _pragma_cursor(cursor):
 if cursor.closed:
  cursor.fetchone = (lambda : None)
  cursor.fetchall = (lambda : [])
 return cursor

def _pragma_cursor ( cursor ) : if cursor . closed : cursor . fetchone = ( lambda : None ) cursor . fetchall = ( lambda : [ ] ) return cursor
work around sqlite issue whereby cursor .