提交 f0364a00 编写于 作者: H Hongze Cheng

fix python close connection error

上级 8b226b5b
...@@ -243,8 +243,8 @@ class CTaosInterface(object): ...@@ -243,8 +243,8 @@ class CTaosInterface(object):
return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8'))) return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8')))
except AttributeError: except AttributeError:
raise AttributeError("sql is expected as a string") raise AttributeError("sql is expected as a string")
finally: # finally:
CTaosInterface.libtaos.close(connection) # CTaosInterface.libtaos.close(connection)
@staticmethod @staticmethod
def affectedRows(connection): def affectedRows(connection):
......
...@@ -243,8 +243,8 @@ class CTaosInterface(object): ...@@ -243,8 +243,8 @@ class CTaosInterface(object):
return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8'))) return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8')))
except AttributeError: except AttributeError:
raise AttributeError("sql is expected as a string") raise AttributeError("sql is expected as a string")
finally: # finally:
CTaosInterface.libtaos.close(connection) # CTaosInterface.libtaos.close(connection)
@staticmethod @staticmethod
def affectedRows(connection): def affectedRows(connection):
......
...@@ -243,8 +243,8 @@ class CTaosInterface(object): ...@@ -243,8 +243,8 @@ class CTaosInterface(object):
return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8'))) return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8')))
except AttributeError: except AttributeError:
raise AttributeError("sql is expected as a string") raise AttributeError("sql is expected as a string")
finally: # finally:
CTaosInterface.libtaos.close(connection) # CTaosInterface.libtaos.close(connection)
@staticmethod @staticmethod
def affectedRows(connection): def affectedRows(connection):
......
...@@ -243,8 +243,8 @@ class CTaosInterface(object): ...@@ -243,8 +243,8 @@ class CTaosInterface(object):
return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8'))) return CTaosInterface.libtaos.taos_query(connection, ctypes.c_char_p(sql.encode('utf-8')))
except AttributeError: except AttributeError:
raise AttributeError("sql is expected as a string") raise AttributeError("sql is expected as a string")
finally: # finally:
CTaosInterface.libtaos.close(connection) # CTaosInterface.libtaos.close(connection)
@staticmethod @staticmethod
def affectedRows(connection): def affectedRows(connection):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册