Skip to content

Commit

Permalink
Merge pull request #111 from rsteube/xonsh-fix-callback
Browse files Browse the repository at this point in the history
xonsh: fix empty callback result
  • Loading branch information
rsteube authored Nov 18, 2020
2 parents 6c6fd64 + 0e28e55 commit a527486
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions example/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,11 @@ def _example_completer(prefix, line, begidx, endidx, ctx):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
cb = cb.decode('utf-8')
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if cb == "":
return {}
else:
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if False:
pass
Expand Down
7 changes: 5 additions & 2 deletions xonsh/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ def _%v_completer(prefix, line, begidx, endidx, ctx):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
cb = cb.decode('utf-8')
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if cb == "":
return {}
else:
nonlocal prefix, line, begidx, endidx, ctx
return eval(cb)
if False:
pass%s
Expand Down

0 comments on commit a527486

Please sign in to comment.