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/tests/t-idiomatic.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lang/python/tests/t-idiomatic.py') diff --git a/lang/python/tests/t-idiomatic.py b/lang/python/tests/t-idiomatic.py index bc05e6c6..faa41906 100755 --- a/lang/python/tests/t-idiomatic.py +++ b/lang/python/tests/t-idiomatic.py @@ -35,6 +35,9 @@ with gpg.Context() as c, gpg.Data() as d: d.write(b"Halloechen") leak_c = c leak_d = d + +leak_c.__del__() +leak_d.__del__() assert leak_c.wrapped is None assert leak_d.wrapped is None -- cgit v1.2.3