diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2013-10-17 13:40:57 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-10-17 13:40:57 (GMT) |
commit | 240f86d7ddbeb3800d39a6d2e6e7a7d1f0c49799 (patch) | |
tree | ec61711162ebf82864716dee27119461c312ba58 /Lib/contextlib.py | |
parent | 1eb509a585c402faa76da85095f1bdae5cd54ef2 (diff) | |
download | cpython-240f86d7ddbeb3800d39a6d2e6e7a7d1f0c49799.zip cpython-240f86d7ddbeb3800d39a6d2e6e7a7d1f0c49799.tar.gz cpython-240f86d7ddbeb3800d39a6d2e6e7a7d1f0c49799.tar.bz2 |
Close #19266: contextlib.ignore -> contextlib.suppress
Patch by Zero Piraeus.
Diffstat (limited to 'Lib/contextlib.py')
-rw-r--r-- | Lib/contextlib.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/contextlib.py b/Lib/contextlib.py index 41ff9cc..144d6bb 100644 --- a/Lib/contextlib.py +++ b/Lib/contextlib.py @@ -5,7 +5,7 @@ from collections import deque from functools import wraps __all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack", - "ignore", "redirect_stdout"] + "redirect_stdout", "suppress"] class ContextDecorator(object): @@ -179,10 +179,10 @@ class redirect_stdout: sys.stdout = self.old_target @contextmanager -def ignore(*exceptions): - """Context manager to ignore specified exceptions +def suppress(*exceptions): + """Context manager to suppress specified exceptions - with ignore(OSError): + with suppress(OSError): os.remove(somefile) """ |