mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 06:46:31 +01:00
Fixed annoying traceback bug (the 'e' bug) that masked errors in importing malformed command modules.
This commit is contained in:
parent
1c632e2c35
commit
699a6ded43
2 changed files with 3 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue