Skip to content

Commit b070622

Browse files
author
Nigel Small
committed
Session.__del__ bug fix
1 parent 12d2891 commit b070622

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

neo4j/v1/session.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,11 @@ def __init__(self, driver):
430430
self.last_cursor = None
431431

432432
def __del__(self):
433-
if not self.connection.closed:
434-
self.connection.close()
433+
try:
434+
if not self.connection.closed:
435+
self.connection.close()
436+
except AttributeError:
437+
pass
435438

436439
def __enter__(self):
437440
return self

0 commit comments

Comments
 (0)