diff options
author | Rob Austein <sra@hactrn.net> | 2008-01-17 02:36:50 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2008-01-17 02:36:50 +0000 |
commit | b1029a0aad0ac179b1cdeeb4d53a4fcc6a4625e3 (patch) | |
tree | f62e8a7bbe8187ede4d233fa7bb8161c41e2a875 /pow/POW-0.7/POW.c | |
parent | 17bfc636ef2e7a74d528737ae67a7038bc065f33 (diff) |
Fix getError() to return None when error stack is empty
svn path=/pow/POW-0.7/POW.c; revision=1480
Diffstat (limited to 'pow/POW-0.7/POW.c')
-rw-r--r-- | pow/POW-0.7/POW.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pow/POW-0.7/POW.c b/pow/POW-0.7/POW.c index 5c7ae203..553d12db 100644 --- a/pow/POW-0.7/POW.c +++ b/pow/POW-0.7/POW.c @@ -7136,6 +7136,7 @@ static char pow_module_get_error__doc__[] = " <body>\n" " <para>\n" " Pops an error off the global error stack and returns it as a string.\n" +" Returns None if the global error stack is empty.\n" " </para>\n" " </body>\n" "</modulefunction>\n" @@ -7151,7 +7152,11 @@ pow_module_get_error(PyObject *self, PyObject *args) goto error; error = ERR_get_error(); - ERR_error_string( error, buf ); + + if (!error) + return Py_None; + + ERR_error_string_n( error, buf, sizeof(buf) ); return Py_BuildValue("s", buf); |