From f8d99bb9e4a7f6229c19c4fbd951ccad6fa97bde Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 9 Aug 2022 09:36:04 +0900 Subject: python: Don't call __del__ from __exit__ method. * lang/python/src/core.py (Context, Data): Don't call __del__ from __exit__ method, as the object may be still in use. * lang/python/tests/t-idiomatic.py: Fix the test. -- GnuPG-bug-id: 6060 Signed-off-by: NIIBE Yutaka --- lang/python/src/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lang/python/src/core.py') diff --git a/lang/python/src/core.py b/lang/python/src/core.py index 81f961d9..c7b312b8 100644 --- a/lang/python/src/core.py +++ b/lang/python/src/core.py @@ -1190,7 +1190,7 @@ class Context(GpgmeWrapper): return self def __exit__(self, type, value, tb): - self.__del__() + return False def op_keylist_all(self, *args, **kwargs): self.op_keylist_start(*args, **kwargs) @@ -1528,7 +1528,7 @@ class Data(GpgmeWrapper): return self def __exit__(self, type, value, tb): - self.__del__() + return False def _free_datacbs(self): self._data_cbs = None -- cgit v1.2.3