summaryrefslogtreecommitdiff
path: root/gi
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2019-08-18 18:51:43 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2019-08-18 18:51:43 +0200
commit86cd509c6acf4f75a146e3afb3334dd49d2dc418 (patch)
tree2f2f5cda9a2a8e6003b321decc6bd2d073a3b922 /gi
parenta102f046a178472278522e3e9d7c0b40ecd52ade (diff)
downloadpygobject-86cd509c6acf4f75a146e3afb3334dd49d2dc418.tar.gz
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.
Diffstat (limited to 'gi')
-rw-r--r--gi/gimodule.c10
1 files changed, 0 insertions, 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.