summaryrefslogtreecommitdiff
path: root/numpy/f2py/cfuncs.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-01-08 09:19:00 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-01-08 09:19:00 +0000
commitaa423d9b2a50e6c20b11f308013b0afcf0b9c6b4 (patch)
tree7468268f26579627ea29d29906dc667aa6f3e26e /numpy/f2py/cfuncs.py
parentd94861c391c3411407da7244881f78e006ac3fb9 (diff)
downloadnumpy-aa423d9b2a50e6c20b11f308013b0afcf0b9c6b4.tar.gz
Avoid putting things into stderr when errors occurs in f2py wrappers; put all the info in the python error string instead.
Diffstat (limited to 'numpy/f2py/cfuncs.py')
-rw-r--r--numpy/f2py/cfuncs.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index 02462241c..5312b0ec5 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -472,15 +472,17 @@ cppmacros['CHECKARRAY']="""\
cppmacros['CHECKSTRING']="""\
#define CHECKSTRING(check,tcheck,name,show,var)\\
\tif (!(check)) {\\
-\t\tPyErr_SetString(#modulename#_error,\"(\"tcheck\") failed for \"name);\\
-\t\tfprintf(stderr,show\"\\n\",slen(var),var);\\
+\t\tchar errstring[256];\\
+\t\tsprintf(errstring, \"%s: \"show, \"(\"tcheck\") failed for \"name, slen(var), var);\\
+\t\tPyErr_SetString(#modulename#_error, errstring);\\
\t\t/*goto capi_fail;*/\\
\t} else """
cppmacros['CHECKSCALAR']="""\
#define CHECKSCALAR(check,tcheck,name,show,var)\\
\tif (!(check)) {\\
-\t\tPyErr_SetString(#modulename#_error,\"(\"tcheck\") failed for \"name);\\
-\t\tfprintf(stderr,show\"\\n\",var);\\
+\t\tchar errstring[256];\\
+\t\tsprintf(errstring, \"%s: \"show, \"(\"tcheck\") failed for \"name, var);\\
+\t\tPyErr_SetString(#modulename#_error,errstring);\\
\t\t/*goto capi_fail;*/\\
\t} else """
## cppmacros['CHECKDIMS']="""\