Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility of check_copy_ast_without_context with Py 3.13b1 #17

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading