[pygobject/deprecation-warning-fixed-base] Make PyGIDeprecationWarning always inherit from DeprecationWarning
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/deprecation-warning-fixed-base] Make PyGIDeprecationWarning always inherit from DeprecationWarning
- Date: Sun, 18 Aug 2019 17:06:47 +0000 (UTC)
commit 86cd509c6acf4f75a146e3afb3334dd49d2dc418
Author: Christoph Reiter <reiter christoph gmail com>
Date: Sun Aug 18 18:51:43 2019 +0200
Make PyGIDeprecationWarning always inherit from DeprecationWarning
To make deprecation warnings more visible we made it inherit from RuntimeWarning
with unstable releases and DeprecationWarning for stabel releases.
This is a bit confusing when being flooded with warnings when testing under jhbuild
etc. Also recent pytest has changed to show deprecation warnings triggered during
tests, so the warnings should be more visible now for devs using pytest.
This changes it to inherit from DeprecationWarning always again.
gi/gimodule.c | 10 ----------
1 file changed, 10 deletions(-)
---
diff --git a/gi/gimodule.c b/gi/gimodule.c
index 2be5e478..c9b29f5a 100644
--- a/gi/gimodule.c
+++ b/gi/gimodule.c
@@ -2521,18 +2521,8 @@ PYGLIB_MODULE_START(_gi, "_gi")
if (PyGIWarning == NULL)
return PYGLIB_MODULE_ERROR_RETURN;
- /* Use RuntimeWarning as the base class of PyGIDeprecationWarning
- * for unstable (odd minor version) and use DeprecationWarning for
- * stable (even minor version). This is so PyGObject deprecations
- * behave the same as regular Python deprecations in stable releases.
- */
-#if PYGOBJECT_MINOR_VERSION % 2
- PyGIDeprecationWarning = PyErr_NewException("gi.PyGIDeprecationWarning",
- PyExc_RuntimeWarning, NULL);
-#else
PyGIDeprecationWarning = PyErr_NewException("gi.PyGIDeprecationWarning",
PyExc_DeprecationWarning, NULL);
-#endif
/* Place holder object used to fill in "from Python" argument lists
* for values not supplied by the caller but support a GI default.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]