_deprecated.py 716 B

1234567891011121314151617181920212223
  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 base64
  9. import urllib.error
  10. import urllib.parse
  11. compat_str = str
  12. compat_b64decode = base64.b64decode
  13. compat_urlparse = urllib.parse
  14. compat_parse_qs = urllib.parse.parse_qs
  15. compat_urllib_parse_unquote = urllib.parse.unquote
  16. compat_urllib_parse_urlencode = urllib.parse.urlencode
  17. compat_urllib_parse_urlparse = urllib.parse.urlparse