aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/compat.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-02-25 19:44:31 +0700
committerSergey M․ <dstftw@gmail.com>2017-02-25 19:44:50 +0700
commit831217291ac05ad75ef16fd6d9985e255489c1e5 (patch)
treedbc652775286c522e1e229ab15a7f0a524d91da5 /youtube_dl/compat.py
parentdb182c63fb4a58974e425a56d235131fd9efc531 (diff)
[compat] Use try except for compat_numeric_types
Diffstat (limited to 'youtube_dl/compat.py')
-rw-r--r--youtube_dl/compat.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py
index b257e2e81..0c119e417 100644
--- a/youtube_dl/compat.py
+++ b/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):