Skip to content

Commit

Permalink
Fixing Decorators (#146)
Browse files Browse the repository at this point in the history
* Fixing Decorators

Minor bug fixes to getargs and getargsorask so that the return of the
wrapped function isn't consumed
  • Loading branch information
DavidAmison authored and natfarleydev committed Jun 13, 2017
1 parent a836ad4 commit 18225d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions skybeard/decorators/getargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ async def g(beard, msg):
args = get_args(msg, return_string=return_string)
try:
if isinstance(args, str):
await f(beard, msg, args)
return await f(beard, msg, args)
else:
await f(beard, msg, *args)
return await f(beard, msg, *args)
except TypeError as exception:
# TODO have configurable messages when args are not enough
err_msg = exception.args[0]
Expand Down
2 changes: 1 addition & 1 deletion skybeard/decorators/getargsorask.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ async def g(beard, msg):
resp = await beard.listener.wait()
kwargs[var] = resp['text']

await f(beard, msg, **kwargs)
return await f(beard, msg, **kwargs)
return g
return _getargsorask_wrapper

0 comments on commit 18225d9

Please sign in to comment.