projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db182c6
)
[compat] Use try except for compat_numeric_types
author
Sergey M․
<dstftw@gmail.com>
Sat, 25 Feb 2017 12:44:31 +0000
(19:44 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 25 Feb 2017 12:44:50 +0000
(19:44 +0700)
youtube_dl/compat.py
patch
|
blob
|
history
diff --git
a/youtube_dl/compat.py
b/youtube_dl/compat.py
index b257e2e8155c72ea6f560c2f7310ed8f5d0bb234..0c119e417ce86174a7b21a9639f160a17a3263a3 100644
(file)
--- 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):