Created
November 12, 2018 02:49
-
-
Save RavenKyu/9c503308757ff4bfbe6d4d40cb5fdd44 to your computer and use it in GitHub Desktop.
with error?
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
class TestClass(object): | |
def a(self): | |
raise TypeError | |
def __enter__(self): | |
return self | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
print(exc_type, exc_val, exc_tb) | |
return True | |
with TestClass() as f: | |
f.a() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment