[Python] Set __spec__ attribute and not __cached__ for ROOT facade#21790
Open
guitargeek wants to merge 1 commit intoroot-project:masterfrom
Open
[Python] Set __spec__ attribute and not __cached__ for ROOT facade#21790guitargeek wants to merge 1 commit intoroot-project:masterfrom
__spec__ attribute and not __cached__ for ROOT facade#21790guitargeek wants to merge 1 commit intoroot-project:masterfrom
Conversation
The Python documentation [1] says: > It is strongly recommended that you use module.__spec__.cached instead of module.__cached__. So this commit suggests to transfer the full `__spec__` attribute from the ROOT module to the facade, instead of `__cached__`. This also avoids errors when importing ROOT with Python 3.15, where `__cached__` will cease to be set or taken into consideration by the import system or standard library. Closes root-project#21787. [1] https://docs.python.org/3/reference/datamodel.html#module.__cached__
Test Results 22 files 22 suites 3d 6h 23m 13s ⏱️ Results for commit 4171724. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Python documentation [1] says:
So this commit suggests to transfer the full
__spec__attribute from the ROOT module to the facade, instead of__cached__.This also avoids errors when importing ROOT with Python 3.15, where
__cached__will cease to be set or taken into consideration by the import system or standard library.Closes #21787.
[1] https://docs.python.org/3/reference/datamodel.html#module.__cached__
Thanks @ellert for reporting the problem!
To be backported to 6.36 and 6.38.