mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Remove redundant code in try..except block
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1350839262 +0530
This commit is contained in:
parent
43bd3c3a17
commit
fd5421670d
@ -42,13 +42,10 @@ class dbConnection(object):
|
||||
with contextlib.closing(conn.cursor(buffered=True)) as cursor:
|
||||
cursor.execute(sql, params)
|
||||
try:
|
||||
result = cursor.fetchall()
|
||||
resultRow = cursor.fetchall()
|
||||
except errors.InterfaceError:
|
||||
#Raised on empty result - DML
|
||||
result = []
|
||||
if result:
|
||||
[resultRow.append(r) for r in result]
|
||||
|
||||
resultRow = []
|
||||
return resultRow
|
||||
|
||||
def executeSqlFromFile(self, fileName=None):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user