Commit 44f3697
committed
fix: Check if connection initialized when deleting Connection
The session is cleaned up when deleting a connection. But, if the
connection was not fully initialized (e.g. due to a connection error)
then no session will be set.
This will cause __del__ to fail and warnings to be printed to stderr.
We can avoid this by checking if session is set and short-circuiting
before checking if the session is open.
Signed-off-by: Tomás Farías <tomas@tomasfarias.dev>1 parent 9fe7356 commit 44f3697
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
0 commit comments