Skip to content

Commit 4ecd8c7

Browse files
committed
close:
check for `_conn` attribute is available on close
1 parent 1f77874 commit 4ecd8c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyard/simple_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def query(self, sql: str):
5151
return self._conn.execute(sql).fetchall()
5252

5353
def close(self):
54-
if self._conn:
54+
if hasattr(self, "_conn") and self._conn:
5555
self._conn.close()
5656

5757
@property

0 commit comments

Comments
 (0)