[pygobject] pygi-source: clear exceptions in finalize handler
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] pygi-source: clear exceptions in finalize handler
- Date: Sat, 1 Apr 2017 16:20:52 +0000 (UTC)
commit c39bf20cca3d1c6bcf89f93759772117d087b042
Author: Christoph Reiter <creiter src gnome org>
Date: Sat Apr 1 17:49:01 2017 +0200
pygi-source: clear exceptions in finalize handler
This was executed in the context of Source.__del__ and while Python
ignores errors there it started to warn with Python 3.
This fixes the warnings visible when running test_source under Python 3.
https://bugzilla.gnome.org/show_bug.cgi?id=780812
gi/pygi-source.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gi/pygi-source.c b/gi/pygi-source.c
index e84c25e..5305260 100644
--- a/gi/pygi-source.c
+++ b/gi/pygi-source.c
@@ -165,6 +165,8 @@ pyg_source_finalize(GSource *source)
} else {
Py_DECREF(t);
}
+ } else {
+ PyErr_Clear ();
}
PyGILState_Release(state);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]