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 find_replacements with Python 3.13 #39185

Merged
merged 3 commits into from
Jan 18, 2025

Conversation

antonio-rojas
Copy link
Contributor

@antonio-rojas antonio-rojas commented Dec 22, 2024

After PEP 667 implementation [1] globals() changes within an exec call are not propagated outside the call

[1] python/cpython@b034f14

Copy link

github-actions bot commented Dec 22, 2024

Documentation preview for this PR (built with commit cee808a; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@user202729
Copy link
Contributor

Instead of using globals() you can probably just use a temporary dict. Otherwise there's a risk of memory leak (the refcount isn't decreased when the function returns)

After PEP 667 implementation [1] locals() changes within an exec call are not propagated outside the call

[1] python/cpython@b034f14
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 7, 2025
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 7, 2025
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 9, 2025
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 9, 2025
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 10, 2025
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 10, 2025
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 12, 2025
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 12, 2025
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2025
    
After PEP 667 implementation [1] `globals()` changes within an `exec`
call are not propagated outside the call

[1] python/cpython@b034f14a4b6e9197d3926046721
b8b4b4b4f5b3d
    
URL: sagemath#39185
Reported by: Antonio Rojas
Reviewer(s): user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2025
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 17, 2025
@vbraun vbraun merged commit 57fa958 into sagemath:develop Jan 18, 2025
23 checks passed
@antonio-rojas antonio-rojas deleted the python-3.13-eval branch January 18, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants