From 364db725ee22b6b93ac27cc3876952e98b25b9ae Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:56:22 -0700 Subject: [PATCH] Add comment --- src/main/policy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/policy.c b/src/main/policy.c index 01aa313cd..1612fc999 100644 --- a/src/main/policy.c +++ b/src/main/policy.c @@ -52,6 +52,13 @@ #define POLICY_UPDATE() *policy_p = policy; +// TODO: Python exceptions should be propagated up instead of being cleared +// but the policy helper functions don't handle this case and they only populate +// an as_error object and return a status code. +// That will take too much time to refactor, so just clear the exception and +// populate the as_error object instead. This currently makes it harder to +// debug why a C-API call failed though, because we don't have the exact +// exception that was thrown #define POLICY_SET_FIELD(__field, __type) \ { \ PyObject *py_field_name = PyUnicode_FromString(#__field); \