Move COMMAND_NESTING safety handler into try..except..finally clause to avoid it ticking up accidentally due to the loop exiting from a traceback.
This commit is contained in:
parent
2ed92e8149
commit
17ee28ab6c
1 changed files with 3 additions and 1 deletions
|
|
@ -472,7 +472,6 @@ def cmdhandler(called_by, raw_string, _testing=False, callertype="session", sess
|
||||||
caller.ndb.last_cmd = yield copy(cmd)
|
caller.ndb.last_cmd = yield copy(cmd)
|
||||||
else:
|
else:
|
||||||
caller.ndb.last_cmd = None
|
caller.ndb.last_cmd = None
|
||||||
_COMMAND_NESTING[called_by] -= 1
|
|
||||||
|
|
||||||
# return result to the deferred
|
# return result to the deferred
|
||||||
returnValue(ret)
|
returnValue(ret)
|
||||||
|
|
@ -480,6 +479,9 @@ def cmdhandler(called_by, raw_string, _testing=False, callertype="session", sess
|
||||||
except Exception:
|
except Exception:
|
||||||
_msg_err(caller, _ERROR_UNTRAPPED)
|
_msg_err(caller, _ERROR_UNTRAPPED)
|
||||||
raise ErrorReported
|
raise ErrorReported
|
||||||
|
finally:
|
||||||
|
_COMMAND_NESTING[called_by] -= 1
|
||||||
|
|
||||||
|
|
||||||
raw_string = to_unicode(raw_string, force_string=True)
|
raw_string = to_unicode(raw_string, force_string=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue