Skip to content

Commit c646128

Browse files
authored
[Platform] improve platforms getattr (#12264)
Signed-off-by: Mengqing Cao <[email protected]>
1 parent 9a7c3a0 commit c646128

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vllm/platforms/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,11 @@ def __getattr__(name: str):
217217
global _init_trace
218218
_init_trace = "".join(traceback.format_stack())
219219
return _current_platform
220-
else:
220+
elif name in globals():
221221
return globals()[name]
222+
else:
223+
raise AttributeError(
224+
f"No attribute named '{name}' exists in {__name__}.")
222225

223226

224227
__all__ = [

0 commit comments

Comments
 (0)