You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/08/30 23:09:04 UTC
svn commit: r1163386 -
/subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
Author: hwright
Date: Tue Aug 30 21:09:04 2011
New Revision: 1163386
URL: http://svn.apache.org/viewvc?rev=1163386&view=rev
Log:
On the fs-py branch:
When creating Subversion errors, set the error code before filling any stack
frames, so that the error code gets set correctly in the tracing frames.
* subversion/libsvn_fs_py/py_util.c
(create_py_stack): Set the error code before doing stack tracing.
Modified:
subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c?rev=1163386&r1=1163385&r2=1163386&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c Tue Aug 30 21:09:04 2011
@@ -47,6 +47,20 @@ create_py_stack(PyObject *p_exception,
_("Exception while executing Python; cause: \"%s\""),
reason);
+ /* If the exception object has a 'code' attribute, and it's an integer,
+ assume it's an apr_err code */
+ if (PyObject_HasAttrString(p_exception, "code"))
+ {
+ PyObject *p_code = PyObject_GetAttrString(p_exception, "code");
+
+ if (PyInt_Check(p_code))
+ {
+ err->apr_err = (int) PyInt_AS_LONG(p_code);
+ }
+
+ Py_DECREF(p_code);
+ }
+
#ifdef SVN_ERR__TRACING
if (p_traceback)
{
@@ -102,18 +116,6 @@ create_py_stack(PyObject *p_exception,
}
#endif
- /* If the exception object has a 'code' attribute, and it's an integer,
- assume it's an apr_err code */
- if (PyObject_HasAttrString(p_exception, "code"))
- {
- PyObject *p_code = PyObject_GetAttrString(p_exception, "code");
-
- if (PyInt_Check(p_code))
- err->apr_err = (int) PyInt_AS_LONG(p_code);
-
- Py_DECREF(p_code);
- }
-
Py_DECREF(p_reason);
return svn_error_trace(err);