[compat] Avoid type comparison in `compat_ord`
authordirkf <fieldhouse@gmx.net>
Tue, 28 May 2024 14:59:34 +0000 (15:59 +0100)
committerdirkf <fieldhouse@gmx.net>
Thu, 30 May 2024 14:46:36 +0000 (15:46 +0100)
NB This isn't actually a compat fn; it should be utils.int_from_int_or_char

youtube_dl/compat.py

index 0371896abc344a0c7fc6d038cd9e6ffa5b6a4e50..ed1a33cf2fb34e2eb256ea8654e90b9c7316cf3d 100644 (file)
@@ -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)