Changeset 5306 for anuga_core/source/anuga/utilities/util_ext.h
- Timestamp:
- May 11, 2008, 8:40:01 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/util_ext.h
r5162 r5306 298 298 } 299 299 300 int get_python_integer(PyObject *O, char *name) { 301 PyObject *TObject; 302 int tmp; 303 304 305 //Get double from attribute 306 TObject = PyObject_GetAttrString(O, name); 307 if (!TObject) { 308 PyErr_SetString(PyExc_RuntimeError, "util_ext.h: get_python_integer could not obtain double from object"); 309 return 0; 310 } 311 312 tmp = PyFloat_AsDouble(TObject); 313 314 Py_DECREF(TObject); 315 316 return tmp; 317 } 318 300 319 301 320 PyObject *get_python_object(PyObject *O, char *name) {
Note: See TracChangeset
for help on using the changeset viewer.