Rename contextlib.ignored() to contextlib.ignore().

This commit is contained in:
Raymond Hettinger 2013-10-10 22:39:39 -07:00
parent a76795bf53
commit 1254b407ac
4 changed files with 13 additions and 13 deletions

View file

@ -5,7 +5,7 @@ from collections import deque
from functools import wraps
__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack",
"ignored", "redirect_stdout"]
"ignore", "redirect_stdout"]
class ContextDecorator(object):
@ -179,10 +179,10 @@ class redirect_stdout:
sys.stdout = self.old_target
@contextmanager
def ignored(*exceptions):
def ignore(*exceptions):
"""Context manager to ignore specified exceptions
with ignored(OSError):
with ignore(OSError):
os.remove(somefile)
"""