gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / blender-2.79-python-3.7-fix.patch
1 Copied from https://git.blender.org/gitweb/gitweb.cgi/blender.git/patch/1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f
2 Fixes <https://bugs.gnu.org/33608>.
3
4 From 1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f Mon Sep 17 00:00:00 2001
5 From: Campbell Barton <ideasman42@gmail.com>
6 Date: Thu, 12 Jul 2018 08:28:06 +0200
7 Subject: [PATCH] Fix PyRNA class registration w/ Python 3.7
8
9 In Python3.7 this now raises an error.
10 ---
11 source/blender/python/intern/bpy_rna.c | 5 +++++
12 1 file changed, 5 insertions(+)
13
14 diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
15 index 9052b6f580a..80b0aa7a51b 100644
16 --- a/source/blender/python/intern/bpy_rna.c
17 +++ b/source/blender/python/intern/bpy_rna.c
18 @@ -7577,10 +7577,12 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
19 if (!(flag & PROP_REGISTER))
20 continue;
21
22 + /* TODO(campbell): Use Python3.7x _PyObject_LookupAttr(), also in the macro below. */
23 identifier = RNA_property_identifier(prop);
24 item = PyObject_GetAttrString(py_class, identifier);
25
26 if (item == NULL) {
27 + PyErr_Clear();
28 /* Sneaky workaround to use the class name as the bl_idname */
29
30 #define BPY_REPLACEMENT_STRING(rna_attr, py_attr) \
31 @@ -7596,6 +7598,9 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
32 } \
33 Py_DECREF(item); \
34 } \
35 + else { \
36 + PyErr_Clear(); \
37 + } \
38 } /* intentionally allow else here */
39
40 if (false) {} /* needed for macro */
41 --
42 2.20.1
43