Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
util: asynchelper: aenter_stack bind lambdas
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <[email protected]>
  • Loading branch information
John Andersen committed Jun 7, 2019
1 parent 36d88ae commit b141cf0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- skel modules have `long_description_content_type` set to "text/markdown"
- Base Orchestrator `__aenter__` and `__aexit__` methods were moved to the
Memory Orchestrator because they are specific to that config.
- Async helper `aenter_stack` uses `inspect.isfunction` so it will bind lambdas

## [0.2.0] - 2019-05-23
### Added
Expand Down
3 changes: 1 addition & 2 deletions dffml/util/asynchelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ async def aenter_stack(
if context_managers is not None:
for key, ctxmanager in context_managers.items():
if call:
# Bind if not bound
if hasattr(ctxmanager, "__self__"):
if inspect.isfunction(ctxmanager):
ctxmanager = ctxmanager.__get__(obj, obj.__class__)
setattr(
obj, key, await stack.enter_async_context(ctxmanager())
Expand Down

0 comments on commit b141cf0

Please sign in to comment.