Fix return in finally warning
This commit is contained in:
parent
b49438a819
commit
0cc31d3a06
1 changed files with 17 additions and 17 deletions
|
|
@ -4241,23 +4241,23 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS):
|
||||||
# treat as string
|
# treat as string
|
||||||
eval_err = err
|
eval_err = err
|
||||||
prototype = utils.to_str(inp)
|
prototype = utils.to_str(inp)
|
||||||
finally:
|
|
||||||
# it's possible that the input was a prototype-key, in which case
|
# it's possible that the input was a prototype-key, in which case
|
||||||
# it's okay for the LITERAL_EVAL to fail. Only if the result does not
|
# it's okay for the LITERAL_EVAL to fail. Only if the result does not
|
||||||
# match the expected type do we have a problem.
|
# match the expected type do we have a problem.
|
||||||
if not isinstance(prototype, expect):
|
if not isinstance(prototype, expect):
|
||||||
if eval_err:
|
if eval_err:
|
||||||
string = (
|
string = (
|
||||||
f"{inp}\n{eval_err}\n|RCritical Python syntax error in argument. Only"
|
f"{inp}\n{eval_err}\n|RCritical Python syntax error in argument. Only"
|
||||||
" primitive Python structures are allowed. \nMake sure to use correct"
|
" primitive Python structures are allowed. \nMake sure to use correct"
|
||||||
" Python syntax. Remember especially to put quotes around all strings"
|
" Python syntax. Remember especially to put quotes around all strings"
|
||||||
" inside lists and dicts.|n For more advanced uses, embed funcparser"
|
" inside lists and dicts.|n For more advanced uses, embed funcparser"
|
||||||
" callables ($funcs) in the strings."
|
" callables ($funcs) in the strings."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
string = f"Expected {expect}, got {type(prototype)}."
|
string = f"Expected {expect}, got {type(prototype)}."
|
||||||
self.msg(string)
|
self.msg(string)
|
||||||
return
|
return
|
||||||
|
|
||||||
if expect == dict:
|
if expect == dict:
|
||||||
# an actual prototype. We need to make sure it's safe,
|
# an actual prototype. We need to make sure it's safe,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue