033e781f79
Fix incorrect director_classic_runme.py test Python SystemError fix with -builtin size_type-correction for SwigPySequence_Cont Python use Py_ssize_t instead of int for better portability Add python inplace-operator caveats to pyopers.swg
29 lines
884 B
Diff
29 lines
884 B
Diff
From 4e8ea4e853efeca6782e905a75f83a5e704a5fb0 Mon Sep 17 00:00:00 2001
|
|
From: William S Fulton <wsf@fultondesigns.co.uk>
|
|
Date: Sat, 14 Nov 2015 22:14:32 +0000
|
|
Subject: [PATCH] Python SystemError fix with -builtin
|
|
|
|
Fix error when append on a SWIG Object with -builtin:
|
|
|
|
x.append(10)
|
|
SystemError: error return without exception set
|
|
|
|
Having append and next methods on a SWIG object by default doesn't seem
|
|
right to me though.
|
|
---
|
|
Lib/python/pyrun.swg | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg
|
|
index 5eedca4..d43b752 100644
|
|
--- a/Lib/python/pyrun.swg
|
|
+++ b/Lib/python/pyrun.swg
|
|
@@ -569,6 +569,7 @@ SwigPyObject_append(PyObject* v, PyObject* next)
|
|
next = tmp;
|
|
#endif
|
|
if (!SwigPyObject_Check(next)) {
|
|
+ PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
|
|
return NULL;
|
|
}
|
|
sobj->next = next;
|