Fixed annoying traceback bug (the 'e' bug) that masked errors in importing malformed command modules.

This commit is contained in:
Griatch 2014-08-19 10:20:26 +02:00
parent 1c632e2c35
commit 699a6ded43
2 changed files with 3 additions and 6 deletions

View file

@ -122,9 +122,8 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
if callable(cmdsetclass):
cmdsetclass = cmdsetclass(cmdsetobj)
return cmdsetclass
except ImportError, e:
errstring += _("Error loading cmdset: Couldn't import module '%s': %s.")
errstring += _("Error loading cmdset '%s': %s.")
errstring = errstring % (modulepath, e)
except KeyError:
errstring += _("Error in loading cmdset: No cmdset class '%(classname)s' in %(modulepath)s.")
@ -133,7 +132,7 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
except SyntaxError, e:
errstring += _("SyntaxError encountered when loading cmdset '%s': %s.")
errstring = errstring % (modulepath, e)
except Exception:
except Exception, e:
errstring += _("Compile/Run error when loading cmdset '%s': %s.")
errstring = errstring % (python_path, e)
@ -144,7 +143,7 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
if emit_to_obj and not ServerConfig.objects.conf("server_starting_mode"):
emit_to_obj.msg(errstring)
err_cmdset = _ErrorCmdSet()
err_cmdset.errmessage = errstring
err_cmdset.errmessage = errstring + _("\n (See log for details.)")
return err_cmdset
# classes

View file

@ -39,7 +39,6 @@ class CmdHome(MuxCommand):
caller.move_to(home)
caller.msg("There's no place like home ...")
class CmdLook(MuxCommand):
"""
look at location or object
@ -62,7 +61,6 @@ class CmdLook(MuxCommand):
"""
caller = self.caller
args = self.args
if args:
# Use search to handle duplicate/nonexistant results.
looking_at_obj = caller.search(args, use_nicks=True)