about summary refs log tree commit diff
diff options
context:
space:
mode:
-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):