X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Fmisc.py;h=24443dd9a82bf035ea43197112ad8da27cd66010;hp=fca279abee5e98c7caf6ef15c6e2956264863724;hb=40fb678ab8ea5e35f06826bda8f484053dd831b1;hpb=e067958404628ee8881e132399f73a760efab8c1 diff --git a/mudpy/misc.py b/mudpy/misc.py index fca279a..24443dd 100644 --- a/mudpy/misc.py +++ b/mudpy/misc.py @@ -1685,9 +1685,9 @@ def handle_user_input(user): user.send("", add_prompt=False, prepend_padding=False) # check to make sure the state is expected, then call that handler - if "handler_" + user.state in globals(): - exec("handler_" + user.state + "(user)") - else: + try: + globals()["handler_" + user.state](user) + except KeyError: generic_menu_handler(user) # since we got input, flag that the menu/prompt needs to be redisplayed