Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _compile (self, request):
sql = request.params [0]
if isinstance (sql, (list, tuple)):
sql = ";\n".join (map (str, sql)) + ";"
try:
sql = sql.strip ()
except AttributeError:
raise dbconnect.SQLError ("Invalid SQL")
if not sql:
raise dbconnect.SQLError ("Empty SQL")
return sql
def _compile (self, request):
sql = request.params [0]
if isinstance (sql, (list, tuple)):
sql = ";\n".join (map (str, sql)) + ";"
try:
sql = sql.strip ()
except AttributeError:
raise dbconnect.SQLError ("Invalid SQL")
if not sql:
raise dbconnect.SQLError ("Empty SQL")
return sql