mirror of
https://github.com/jazzband/contextlib2.git
synced 2026-03-17 06:00:23 +00:00
recreate_cm() also emits DeprecatingWarning
This commit is contained in:
parent
c223508344
commit
3c49b081bc
1 changed files with 2 additions and 1 deletions
|
|
@ -114,6 +114,7 @@ class ContextDecorator(object):
|
|||
DEPRECATED: refresh_cm was never added to the standard library's
|
||||
ContextDecorator API
|
||||
"""
|
||||
import warnings # Only import if needed for the deprecation warning
|
||||
warnings.warn("refresh_cm was never added to the standard library",
|
||||
DeprecationWarning)
|
||||
return self._recreate_cm()
|
||||
|
|
@ -857,7 +858,7 @@ class chdir(AbstractContextManager):
|
|||
|
||||
# Preserve backwards compatibility
|
||||
class ContextStack(ExitStack):
|
||||
"""Backwards compatibility alias for ExitStack"""
|
||||
"""(DEPRECATED) Backwards compatibility alias for ExitStack"""
|
||||
|
||||
def __init__(self):
|
||||
import warnings # Only import if needed for the deprecation warning
|
||||
|
|
|
|||
Loading…
Reference in a new issue