[pygobject] Remove unused pygi_register_exception_for_domain()



commit 8b55a207cdb8a1ec5c1cdcce48f69d292192f9b7
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Thu Apr 5 09:16:51 2018 +0200

    Remove unused pygi_register_exception_for_domain()

 gi/pygi-error.c | 37 -------------------------------------
 gi/pygi-error.h |  3 ---
 2 files changed, 40 deletions(-)
---
diff --git a/gi/pygi-error.c b/gi/pygi-error.c
index c7780505..94cbdd21 100644
--- a/gi/pygi-error.c
+++ b/gi/pygi-error.c
@@ -28,7 +28,6 @@
 
 
 PyObject *PyGError = NULL;
-static PyObject *exception_table = NULL;
 
 /**
  * pygi_error_marshal_to_py:
@@ -55,13 +54,6 @@ pygi_error_marshal_to_py (GError **error)
     state = PyGILState_Ensure();
 
     exc_type = PyGError;
-    if (exception_table != NULL)
-    {
-        PyObject *item;
-        item = PyDict_GetItem(exception_table, PYGLIB_PyLong_FromLong((*error)->domain));
-        if (item != NULL)
-            exc_type = item;
-    }
 
     if ((*error)->domain) {
         domain = g_quark_to_string ((*error)->domain);
@@ -226,35 +218,6 @@ pygi_gerror_exception_check (GError **error)
 
 }
 
-/**
- * pygi_register_exception_for_domain:
- * @name: name of the exception
- * @error_domain: error domain
- *
- * Registers a new GLib.Error exception subclass called #name for
- * a specific #domain. This exception will be raised when a GError
- * of the same domain is passed in to pygi_error_check().
- *
- * Returns: the new exception
- */
-PyObject *
-pygi_register_exception_for_domain (gchar *name,
-                                    gint error_domain)
-{
-    PyObject *exception;
-
-    exception = PyErr_NewException(name, PyGError, NULL);
-
-    if (exception_table == NULL)
-        exception_table = PyDict_New();
-
-    PyDict_SetItem(exception_table,
-                   PYGLIB_PyLong_FromLong(error_domain),
-                   exception);
-
-    return exception;
-}
-
 static gboolean
 _pygi_marshal_from_py_gerror (PyGIInvokeState   *state,
                               PyGICallableCache *callable_cache,
diff --git a/gi/pygi-error.h b/gi/pygi-error.h
index 21f188d9..3e6c4144 100644
--- a/gi/pygi-error.h
+++ b/gi/pygi-error.h
@@ -38,9 +38,6 @@ gboolean      pygi_error_marshal_from_py    (PyObject  *pyerr,
 
 gboolean      pygi_gerror_exception_check   (GError **error);
 
-PyObject*     pygi_register_exception_for_domain (gchar *name,
-                                                  gint   error_domain);
-
 PyGIArgCache* pygi_arg_gerror_new_from_info (GITypeInfo    *type_info,
                                              GIArgInfo     *arg_info,   /* may be null */
                                              GITransfer     transfer,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]