From 699a6ded430bfdf6feda3560798f070f926c2ffd Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 19 Aug 2014 10:20:26 +0200 Subject: [PATCH] Fixed annoying traceback bug (the 'e' bug) that masked errors in importing malformed command modules. --- src/commands/cmdsethandler.py | 7 +++---- src/commands/default/general.py | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/commands/cmdsethandler.py b/src/commands/cmdsethandler.py index 2056d1c931..aad9a87dd9 100644 --- a/src/commands/cmdsethandler.py +++ b/src/commands/cmdsethandler.py @@ -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 diff --git a/src/commands/default/general.py b/src/commands/default/general.py index d2d65f81fa..37bf8aa719 100644 --- a/src/commands/default/general.py +++ b/src/commands/default/general.py @@ -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)