Deprecate compiled_regex_type

This commit is contained in:
sepro 2024-11-06 21:18:15 +01:00
parent 223d141ad4
commit 6bb94a80c0
3 changed files with 5 additions and 3 deletions

View File

@ -321,6 +321,7 @@ banned-from = [
"yt_dlp.compat.compat_os_name".msg = "Use `os.name` instead."
"yt_dlp.compat.compat_realpath".msg = "Use `os.path.realpath` instead."
"yt_dlp.utils.decodeOption".msg = "Do not use"
"yt_dlp.utils.compiled_regex_type".msg = "Use `re.Pattern` instead."
[tool.autopep8]
max_line_length = 120

View File

@ -9,6 +9,7 @@ passthrough_module(__name__, '.._legacy', callback=lambda attr: warnings.warn(
del passthrough_module
import re
import struct
@ -25,3 +26,6 @@ def intlist_to_bytes(xs):
if not xs:
return b''
return struct.pack('%dB' % len(xs), *xs)
compiled_regex_type = type(re.compile(''))

View File

@ -54,9 +54,6 @@ from ..dependencies import xattr
__name__ = __name__.rsplit('.', 1)[0] # noqa: A001: Pretend to be the parent module
# This is not clearly defined otherwise
compiled_regex_type = type(re.compile(''))
class NO_DEFAULT:
pass