Warn of (pending) deprecation.
(description=None, deprecation=None,
removal=None, alternative=None, stacklevel=2)
| 21 | |
| 22 | |
| 23 | def warn(description=None, deprecation=None, |
| 24 | removal=None, alternative=None, stacklevel=2): |
| 25 | """Warn of (pending) deprecation.""" |
| 26 | ctx = {'description': description, |
| 27 | 'deprecation': deprecation, 'removal': removal, |
| 28 | 'alternative': alternative} |
| 29 | if deprecation is not None: |
| 30 | w = CPendingDeprecationWarning(PENDING_DEPRECATION_FMT.format(**ctx)) |
| 31 | else: |
| 32 | w = CDeprecationWarning(DEPRECATION_FMT.format(**ctx)) |
| 33 | warnings.warn(w, stacklevel=stacklevel) |
| 34 | |
| 35 | |
| 36 | def Callable(deprecation=None, removal=None, |
no test coverage detected