Skip to content

Commit

Permalink
Fix compatibility of check_copy_ast_without_context with Py 3.13b1
Browse files Browse the repository at this point in the history
Resolves: #16
  • Loading branch information
frenzymadness committed May 15, 2024
1 parent 3d1564d commit 42e8a1f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ def check_copy_ast_without_context(tree):
dump1 = ast.dump(tree)
dump2 = ast.dump(tree2)
normalised_dump1 = re.sub(
r", ctx=(Load|Store|Del)\(\)",
# Two possible matches:
# - first one like ", ctx=…" where ", " should be removed
# - second one like "(ctx=…" where "(" should be kept
(
r"("
r", ctx=(Load|Store|Del)\(\)"
r"|"
r"(?<=\()ctx=(Load|Store|Del)\(\)"
r")"
),
"",
dump1
)
Expand Down

0 comments on commit 42e8a1f

Please sign in to comment.