NO-JIRA: Fix ignored python exceptions "Selectable' object has no attribute '_impl"
Fix errors introduced by: e769ad5 NO-JIRA: Fix core dumps and memory management errors in python binding, engine.py. Deleted attribute _impl was later being checked for None. Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f22fa7fc Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f22fa7fc Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f22fa7fc Branch: refs/heads/master Commit: f22fa7fc4391db3929fe83760d213fd139a4338e Parents: d042c4e Author: Alan Conway <[email protected]> Authored: Fri Dec 12 15:32:22 2014 -0500 Committer: Alan Conway <[email protected]> Committed: Fri Dec 12 15:48:03 2014 -0500 ---------------------------------------------------------------------- proton-c/bindings/python/proton/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f22fa7fc/proton-c/bindings/python/proton/__init__.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py index 543f3da..b54b445 100644 --- a/proton-c/bindings/python/proton/__init__.py +++ b/proton-c/bindings/python/proton/__init__.py @@ -1220,7 +1220,7 @@ indicate whether the fd has been registered or not. if self._impl: del self.messenger._selectables[self.fileno()] pn_selectable_free(self._impl) - del self._impl + self._impl = None def __del__(self): self.free() @@ -3465,7 +3465,7 @@ class Connector(object): def _release(self): """Release the underlying C Engine resource.""" - if self._cxtr: + if hasattr(self, '_cxtr'): pn_connector_set_context(self._cxtr, pn_py2void(None)) pn_connector_free(self._cxtr) del self._cxtr @@ -3549,7 +3549,7 @@ class Listener(object): def _release(self): """Release the underlying C Engine resource.""" - if self._lsnr: + if hasattr(self, '_lsnr'): pn_listener_set_context(self._lsnr, pn_py2void(None)); pn_listener_free(self._lsnr) del self._lsnr --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
