summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/python
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/modules/python/eval.hpp11
-rw-r--r--sca-cpp/trunk/modules/python/server-test.py14
2 files changed, 10 insertions, 15 deletions
diff --git a/sca-cpp/trunk/modules/python/eval.hpp b/sca-cpp/trunk/modules/python/eval.hpp
index bf539faa38..65cd7f0ef7 100644
--- a/sca-cpp/trunk/modules/python/eval.hpp
+++ b/sca-cpp/trunk/modules/python/eval.hpp
@@ -66,17 +66,12 @@ const string lastError() {
PyObject* sval = PyObject_Str(val);
string msg = string() + PyString_AsString(stype) + " : " + PyString_AsString(sval);
Py_DECREF(stype);
- Py_DECREF(sval);
- Py_DECREF(type);
- Py_DECREF(val);
- Py_XDECREF(trace);
+ Py_DECREF(sval);
+ PyErr_Restore(type, val, trace);
PyErr_Print();
return msg;
}
- PyErr_Print();
- Py_XDECREF(type);
- Py_XDECREF(val);
- Py_XDECREF(trace);
+ PyErr_Restore(type, val, trace);
PyErr_Print();
return "Unknown Python error";
}
diff --git a/sca-cpp/trunk/modules/python/server-test.py b/sca-cpp/trunk/modules/python/server-test.py
index 29404c3753..da5d216da5 100644
--- a/sca-cpp/trunk/modules/python/server-test.py
+++ b/sca-cpp/trunk/modules/python/server-test.py
@@ -24,13 +24,13 @@ def echo(x):
def get(id):
if id == ():
- return ("Sample Feed", "123456789",
- ("Item", "111", (("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99))),
- ("Item", "222", (("'name", "Orange"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 3.55))),
- ("Item", "333", (("'name", "Pear"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 1.55))))
-
- entry = (("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99))
- return ("Item", id[0], entry)
+ return (("'feed", ("'title", "Sample Feed"), ("'id", "123456789"), ("'entry",
+ ((("'title", "Item"), ("'id", "111"), ("'content", ("'item", ("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99)))),
+ (("'title", "Item"), ("'id", "222"), ("'content", ("'item", ("'name", "Orange"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 3.55)))),
+ (("'title", "Item"), ("'id", "333"), ("'content", ("'item", ("'name", "Pear"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 1.55))))))),)
+
+ content = ("'content", ("'item", ("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99)))
+ return (("'entry", ("'title", "Item"), ("'id", id[0]), content),)
def post(collection, item):
return ("123456789",)