Clear the current Python error when returning an error code to xpcom

git-svn-id: svn://10.0.0.236/branches/DOM_AGNOSTIC_BRANCH@179903 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2005-09-09 14:36:29 +00:00
parent 985422a570
commit 0dd0630a4e

View File

@@ -225,6 +225,14 @@ nsresult PyXPCOM_SetCOMErrorFromPyException()
if (!PyErr_Occurred())
// No error occurred
return NS_OK;
// todo:
// * Translate PyExc_MemoryError to NS_ERROR_OUT_OF_MEMORY
// * Set an exception using the exception service.
// Once we have returned to pyxpcom, we don't want to leave a
// Python exception pending - it may get noticed when the next call
// is made on the same thread.
PyErr_Clear();
return NS_ERROR_FAILURE;
}