Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide context manager wrapper #19

Closed
h2non opened this issue Oct 26, 2016 · 1 comment
Closed

Provide context manager wrapper #19

h2non opened this issue Oct 26, 2016 · 1 comment
Assignees

Comments

@h2non
Copy link
Owner

h2non commented Oct 26, 2016

@paco.contextmanager
async def test(_yield, foo):
  await foo()
  try:
    await _yield('foo')
  except Exception as err:
    ctx.error(err)
  await bar()

# Usage
async with test('foo') as foo:
  pass
@h2non h2non self-assigned this Oct 26, 2016
@h2non h2non closed this as completed Oct 28, 2016
@h2non
Copy link
Owner Author

h2non commented Oct 28, 2016

Deprecated. Will be supported as standalone library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant