[pygobject] enum/flags: use the tp_hash from the right base class
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] enum/flags: use the tp_hash from the right base class
- Date: Sat, 31 Mar 2018 21:56:29 +0000 (UTC)
commit b201097a42bc35de39a000b566f88f49ba2af172
Author: Christoph Reiter <reiter christoph gmail com>
Date: Sat Mar 31 23:54:20 2018 +0200
enum/flags: use the tp_hash from the right base class
I missed that on Python 2 we subclass int.
gi/pygenum.c | 2 +-
gi/pygflags.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/pygenum.c b/gi/pygenum.c
index dd324700..0e7c1e31 100644
--- a/gi/pygenum.c
+++ b/gi/pygenum.c
@@ -376,7 +376,7 @@ pygi_enum_register_types(PyObject *d)
PyGEnum_Type.tp_base = &PYGLIB_PyLong_Type;
PyGEnum_Type.tp_new = pyg_enum_new;
- PyGEnum_Type.tp_hash = PyLong_Type.tp_hash;
+ PyGEnum_Type.tp_hash = PYGLIB_PyLong_Type.tp_hash;
PyGEnum_Type.tp_repr = (reprfunc)pyg_enum_repr;
PyGEnum_Type.tp_str = (reprfunc)pyg_enum_repr;
PyGEnum_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
diff --git a/gi/pygflags.c b/gi/pygflags.c
index f59612db..d9f38175 100644
--- a/gi/pygflags.c
+++ b/gi/pygflags.c
@@ -505,7 +505,7 @@ pygi_flags_register_types(PyObject *d)
PyGFlags_Type.tp_base = &PYGLIB_PyLong_Type;
PyGFlags_Type.tp_new = pyg_flags_new;
- PyGFlags_Type.tp_hash = PyLong_Type.tp_hash;
+ PyGFlags_Type.tp_hash = PYGLIB_PyLong_Type.tp_hash;
PyGFlags_Type.tp_repr = (reprfunc)pyg_flags_repr;
PyGFlags_Type.tp_as_number = &pyg_flags_as_number;
PyGFlags_Type.tp_str = (reprfunc)pyg_flags_repr;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]