_deprecated.py 570 B

123456789101112131415161718192021
  1. """Deprecated - New code should avoid these"""
  2. import warnings
  3. from .compat_utils import passthrough_module
  4. # XXX: Implement this the same way as other DeprecationWarnings without circular import
  5. passthrough_module(__name__, '.._legacy', callback=lambda attr: warnings.warn(
  6. DeprecationWarning(f'{__name__}.{attr} is deprecated'), stacklevel=6))
  7. del passthrough_module
  8. import functools # noqa: F401
  9. import os
  10. compat_os_name = os.name
  11. compat_realpath = os.path.realpath
  12. def compat_shlex_quote(s):
  13. from ..utils import shell_quote
  14. return shell_quote(s)