Skip to content

Commit 8374d02

Browse files
committed
[Python] Set __spec__ attribute and not __cached__ for ROOT facade
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 #21787. [1] https://docs.python.org/3/reference/datamodel.html#module.__cached__
1 parent 66c0195 commit 8374d02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • bindings/pyroot/pythonizations/python/ROOT

bindings/pyroot/pythonizations/python/ROOT/_facade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(self, module, is_ipython):
142142
self.__all__ = module.__all__
143143
self.__name__ = module.__name__
144144
self.__file__ = module.__file__
145-
self.__cached__ = module.__cached__
145+
self.__spec__ = module.__spec__
146146
self.__path__ = module.__path__
147147
self.__doc__ = module.__doc__
148148
self.__package__ = module.__package__

0 commit comments

Comments
 (0)