-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyre: correctly type functions passed to @contextlib.contextmanager.
Summary: This seems to be a fairly common mistake: the `contextlib.contextmanager` decorator is applied to functions that return an `Iterator`, and turns them into ContextManagers. The decorated functions should *not* be typed to return ContextManager. This changes typing so that it can be properly applied. Test Plan: CI Differential Revision: D50840616 fbshipit-source-id: 404f1d39b5bda77abd399006dac11f1e0111824c
- Loading branch information
1 parent
7bb401c
commit bc1756a
Showing
2 changed files
with
7 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters