mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-09 14:37:06 +01:00
[compat] Use try except for compat_numeric_types
This commit is contained in:
parent
db182c63fb
commit
831217291a
@ -2760,8 +2760,10 @@ def compat_kwargs(kwargs):
|
|||||||
compat_kwargs = lambda kwargs: kwargs
|
compat_kwargs = lambda kwargs: kwargs
|
||||||
|
|
||||||
|
|
||||||
compat_numeric_types = ((int, float, long, complex) if sys.version_info[0] < 3
|
try:
|
||||||
else (int, float, complex))
|
compat_numeric_types = (int, float, long, complex)
|
||||||
|
except NameError: # Python 3
|
||||||
|
compat_numeric_types = (int, float, complex)
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
|
Loading…
Reference in New Issue
Block a user