Skip to content

Commit

Permalink
Disable EvalEnvironment comparison in Python 3.13+.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwardrop committed Nov 12, 2024
1 parent b62ecc6 commit 8c3c837
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions patsy/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import tokenize
import ast
import numbers
import pytest
from patsy import PatsyError
from patsy.util import PushbackAdapter, no_pickling, assert_no_pickling
from patsy.tokens import pretty_untokenize, normalize_token_spacing, python_tokenize
Expand Down Expand Up @@ -423,6 +424,13 @@ def test_EvalEnvironment_subset():
pytest.raises(NameError, subset_bc.eval, "a")


@pytest.mark.skipif(
sys.version_info >= (3, 13),
reason=(
"`frame.f_locals` may return write-through proxies in Python 3.13+, "
"breaking direct comparison by ids."
),
)
def test_EvalEnvironment_eq():
# Two environments are eq only if they refer to exactly the same
# global/local dicts
Expand Down

0 comments on commit 8c3c837

Please sign in to comment.