Skip to content

Commit

Permalink
Merge pull request #17 from frenzymadness/py313b1
Browse files Browse the repository at this point in the history
Fix compatibility of check_copy_ast_without_context with Py 3.13b1
  • Loading branch information
alexmojaki authored May 15, 2024
2 parents 3d1564d + 42e8a1f commit c1dd5b3
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 c1dd5b3

Please sign in to comment.