[Platform] improve platforms getattr (#12264)

Signed-off-by: Mengqing Cao <cmq0113@163.com>
This commit is contained in:
Mengqing Cao 2025-01-21 22:42:41 +08:00 committed by GitHub
parent 9a7c3a0042
commit c64612802b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -217,8 +217,11 @@ def __getattr__(name: str):
global _init_trace
_init_trace = "".join(traceback.format_stack())
return _current_platform
else:
elif name in globals():
return globals()[name]
else:
raise AttributeError(
f"No attribute named '{name}' exists in {__name__}.")
__all__ = [