From: dirkf Date: Tue, 28 May 2024 14:59:34 +0000 (+0100) Subject: [compat] Avoid type comparison in `compat_ord` X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=768ccccd9b18bc48d129b12d14eace4ebb3655d8;p=youtube-dl [compat] Avoid type comparison in `compat_ord` NB This isn't actually a compat fn; it should be utils.int_from_int_or_char --- diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py index 0371896ab..ed1a33cf2 100644 --- a/youtube_dl/compat.py +++ b/youtube_dl/compat.py @@ -2970,7 +2970,7 @@ except (AssertionError, UnicodeEncodeError): def compat_ord(c): - if type(c) is int: + if isinstance(c, int): return c else: return ord(c)