Browse Source
[compat] Use try except for compat_numeric_types
master
Sergey M․
8 years ago
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with
4 additions and
2 deletions
-
youtube_dl/compat.py
|
|
@ -2760,8 +2760,10 @@ else: |
|
|
|
compat_kwargs = lambda kwargs: kwargs |
|
|
|
|
|
|
|
|
|
|
|
compat_numeric_types = ((int, float, long, complex) if sys.version_info[0] < 3 |
|
|
|
else (int, float, complex)) |
|
|
|
try: |
|
|
|
compat_numeric_types = (int, float, long, complex) |
|
|
|
except NameError: # Python 3 |
|
|
|
compat_numeric_types = (int, float, complex) |
|
|
|
|
|
|
|
|
|
|
|
if sys.version_info < (2, 7): |
|
|
|