Remove exec() from handle_user_input() function
[mudpy.git] / mudpy / misc.py
index fca279a..24443dd 100644 (file)
@@ -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