summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo.alcantara@openbossa.org>2011-10-19 16:30:36 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-10-20 15:47:13 -0200
commit74ad07ffeea407d9e565607e9189ccedba3aceef (patch)
treeac40b8eaa1d8aff32cf07d14cbb53f27adb5d323
parentd68c6b99a6f376bf893c43689bae5d3004a13473 (diff)
downloadpyside-74ad07ffeea407d9e565607e9189ccedba3aceef.tar.gz
pyside-74ad07ffeea407d9e565607e9189ccedba3aceef.tar.xz
pyside-74ad07ffeea407d9e565607e9189ccedba3aceef.zip
Fix bug 1022 - "RuntimeError: maximum recursion depth exceeded while getting the str of an object"
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org> Signed-off-by: Paulo Alcantara <paulo.alcantara@openbossa.org>
-rw-r--r--PySide/QtScript/typesystem_script.xml3
-rw-r--r--tests/QtScript/CMakeLists.txt1
-rw-r--r--tests/QtScript/bug_1022.py13
3 files changed, 16 insertions, 1 deletions
diff --git a/PySide/QtScript/typesystem_script.xml b/PySide/QtScript/typesystem_script.xml
index 4dc3930..af2f198 100644
--- a/PySide/QtScript/typesystem_script.xml
+++ b/PySide/QtScript/typesystem_script.xml
@@ -66,7 +66,8 @@
QString format = QString().sprintf("%s(\"%s\")", ((PyObject*)%PYSELF)->ob_type->tp_name, qPrintable(%CPPSELF.toString()));
%PYARG_0 = Shiboken::String::fromCString(qPrintable(format));
} else {
- %PYARG_0 = PyObject_Str((PyObject*)%PYSELF);
+ %PYARG_0 = Shiboken::String::fromCString(
+ ((PyObject* )%PYSELF)->ob_type->tp_name);
}
</inject-code>
</add-function>
diff --git a/tests/QtScript/CMakeLists.txt b/tests/QtScript/CMakeLists.txt
index a3c7c7d..dfea68d 100644
--- a/tests/QtScript/CMakeLists.txt
+++ b/tests/QtScript/CMakeLists.txt
@@ -1,4 +1,5 @@
PYSIDE_TEST(base_test.py)
+PYSIDE_TEST(bug_1022.py)
PYSIDE_TEST(engine_test.py)
PYSIDE_TEST(property_test.py)
PYSIDE_TEST(qscriptvalue_test.py)
diff --git a/tests/QtScript/bug_1022.py b/tests/QtScript/bug_1022.py
new file mode 100644
index 0000000..3a24614
--- /dev/null
+++ b/tests/QtScript/bug_1022.py
@@ -0,0 +1,13 @@
+import unittest
+
+from PySide.QtCore import *
+from PySide.QtScript import *
+
+class QScriptValueTest(unittest.TestCase):
+ def testQScriptValue(self):
+ app = QCoreApplication([])
+ engine = QScriptEngine()
+ repr(engine.evaluate('1 + 1'))
+
+if __name__ == '__main__':
+ unittest.main()