Added an error_check_python_modules function to evennia.py. This basically imports a host of critical modules and quits with tracebacks if there are problems. This catches pure python-syntax errors (i.e. cases where the source-file itself is malformed), something which is hard to properly handle in the running server (where there's also an issue as to how to best report it). Best they fail out already at an early stage.
This commit is contained in:
parent
e379816866
commit
703accdd60
7 changed files with 59 additions and 9 deletions
|
|
@ -243,10 +243,10 @@ class CmdSet(object):
|
|||
# add all commands
|
||||
if not hasattr(cmd, 'obj'):
|
||||
cmd.obj = self.cmdsetobj
|
||||
ic = [i for i, oldcmd in enumerate(self.commands) if oldcmd.match(cmd)]
|
||||
if ic:
|
||||
self.commands[ic[0]] = cmd # replace
|
||||
else:
|
||||
try:
|
||||
ic = self.commands.index(cmd)
|
||||
self.commands[ic] = cmd # replace
|
||||
except ValueError:
|
||||
self.commands.append(cmd)
|
||||
# extra run to make sure to avoid doublets
|
||||
self.commands = list(set(self.commands))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue