mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 16:56:32 +01:00
Cleaner error message passing reserved kwarg to EvMenu
This commit is contained in:
parent
ff59163d22
commit
1c7a6dfd21
1 changed files with 4 additions and 3 deletions
|
|
@ -477,7 +477,7 @@ class EvMenu:
|
|||
self.test_nodetext = ""
|
||||
|
||||
# assign kwargs as initialization vars on ourselves.
|
||||
if set(
|
||||
reserved_clash = set(
|
||||
(
|
||||
"_startnode",
|
||||
"_menutree",
|
||||
|
|
@ -491,9 +491,10 @@ class EvMenu:
|
|||
"cmdset_mergetype",
|
||||
"auto_quit",
|
||||
)
|
||||
).intersection(set(kwargs.keys())):
|
||||
).intersection(set(kwargs.keys()))
|
||||
if reserved_clash:
|
||||
raise RuntimeError(
|
||||
"One or more of the EvMenu `**kwargs` is reserved by EvMenu for internal use."
|
||||
f"One or more of the EvMenu `**kwargs` ({list(reserved_clash)}) is reserved by EvMenu for internal use."
|
||||
)
|
||||
for key, val in kwargs.items():
|
||||
setattr(self, key, val)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue