You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using context managers defined with classes, and an exception is raised and handled in the __exit__ block without a try/except, the rest of the code is marked as unreachable although it is perfectly reachable if the __exit__ method returns True
Describe the bug
When using context managers defined with classes, and an exception is raised and handled in the
__exit__
block without a try/except, the rest of the code is marked as unreachable although it is perfectly reachable if the__exit__
method returnsTrue
To Reproduce
The print statement is marked with "Code is unreachable" although it is.
Expected behavior
The return of the
__exit__
method should be checked and the warning should be applied only if it isFalse
Screenshots or Code
VS Code extension or command-line
Pyright was used as a VS Code extension.
Pyright Version: v1.1.79
VS Code Info:
Version: 1.50.1 (user setup)
Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
Date: 2020-10-13T15:06:15.712Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041
The text was updated successfully, but these errors were encountered: