Skip to content

Commit

Permalink
Set state->fail_after_count = -1 after triggering an exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Nov 16, 2024
1 parent c76a917 commit 3b4e81a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Modules/_sre/sre_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,10 @@ typedef struct {
do { \
_MAYBE_CHECK_SIGNALS; \
if (state->fail_after_count >= 0) { \
if (state->fail_after_count == 0) { \
if (state->fail_after_count-- == 0) { \
PyErr_SetNone(state->fail_after_exc); \
RETURN_ERROR(SRE_ERROR_INTERRUPTED); \
} \
state->fail_after_count--; \
} \
} while (0)
#else
Expand Down

0 comments on commit 3b4e81a

Please sign in to comment.