billdeitrick / pypco

A Python client for the Planning Center Online API.
MIT License
39 stars 13 forks source link

fix: fixed teardown of PCO class where authentication failed #74

Open 2000game opened 1 year ago

2000game commented 1 year ago

When tearing down an PCO class, that was initialized without parameters, first an PCOCredentialsexception error occurs. When that is catched, an AttributeError occurs, because during teardown it tries to close the session which won't hasn't been defined yet.

.....Exception ignored in: <function PCO.__del__ at 0x7fdb3dc83ee0>
Traceback (most recent call last):
  File "/home/fk/pypco/pypco/pco.py", line 539, in __del__
    if self.session is not None:
AttributeError: 'PCO' object has no attribute 'session'