From 86cd509c6acf4f75a146e3afb3334dd49d2dc418 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 18 Aug 2019 18:51:43 +0200 Subject: 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(-) (limited to 'gi') 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. -- cgit v1.2.1