diff options
author | felix <felix.von.s@posteo.de> | 2021-12-30 13:23:36 +0100 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-04-12 05:32:50 +0530 |
commit | cfb0511d822b39748c5a64dfe86b61ff8d5af176 (patch) | |
tree | 3988b2fd19f0b1bdf5e946381a1e96d86b39a2c0 /yt_dlp/update.py | |
parent | ab96d1ad1bcdb943aa6519980e5383ca91f7da2b (diff) | |
download | hypervideo-pre-cfb0511d822b39748c5a64dfe86b61ff8d5af176.tar.lz hypervideo-pre-cfb0511d822b39748c5a64dfe86b61ff8d5af176.tar.xz hypervideo-pre-cfb0511d822b39748c5a64dfe86b61ff8d5af176.zip |
[cleanup] Remove unused code paths (#2173)
Notes:
* `_windows_write_string`: Fixed in 3.6
* https://bugs.python.org/issue1602
* PEP: https://www.python.org/dev/peps/pep-0528
* Windows UTF-8 fix: Fixed in 3.3
* https://bugs.python.org/issue13216
* `__loader__`: is always present in 3.3+
* https://bugs.python.org/issue14646
* `workaround_optparse_bug9161`: Fixed in 2.7
* https://bugs.python.org/issue9161
Authored by: fstirlitz
Diffstat (limited to 'yt_dlp/update.py')
-rw-r--r-- | yt_dlp/update.py | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/yt_dlp/update.py b/yt_dlp/update.py index a208e163c..f6ac207a1 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -15,22 +15,6 @@ from .utils import encode_compat_str, Popen, write_string from .version import __version__ -''' # Not signed -def rsa_verify(message, signature, key): - from hashlib import sha256 - assert isinstance(message, bytes) - byte_size = (len(bin(key[0])) - 2 + 8 - 1) // 8 - signature = ('%x' % pow(int(signature, 16), key[1], key[0])).encode() - signature = (byte_size * 2 - len(signature)) * b'0' + signature - asn1 = b'3031300d060960864801650304020105000420' - asn1 += sha256(message).hexdigest().encode() - if byte_size < len(asn1) // 2 + 11: - return False - expected = b'0001' + (byte_size - len(asn1) // 2 - 3) * b'ff' + b'00' + asn1 - return expected == signature -''' - - def detect_variant(): if hasattr(sys, 'frozen'): prefix = 'mac' if sys.platform == 'darwin' else 'win' @@ -39,7 +23,7 @@ def detect_variant(): return f'{prefix}_dir' return f'{prefix}_exe' return 'py2exe' - elif isinstance(globals().get('__loader__'), zipimporter): + elif isinstance(__loader__, zipimporter): return 'zip' elif os.path.basename(sys.argv[0]) == '__main__.py': return 'source' @@ -232,24 +216,6 @@ def run_update(ydl): assert False, f'Unhandled variant: {variant}' -''' # UNUSED -def get_notes(versions, fromVersion): - notes = [] - for v, vdata in sorted(versions.items()): - if v > fromVersion: - notes.extend(vdata.get('notes', [])) - return notes - - -def print_notes(to_screen, versions, fromVersion=__version__): - notes = get_notes(versions, fromVersion) - if notes: - to_screen('PLEASE NOTE:') - for note in notes: - to_screen(note) -''' - - # Deprecated def update_self(to_screen, verbose, opener): |