浏览代码

[compat] Add compat_input

Sergey M․ 9 年之前
父节点
当前提交
1ae6c83bce
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      youtube_dl/compat.py

+ 5 - 0
youtube_dl/compat.py

@@ -482,6 +482,11 @@ if sys.version_info < (3, 0) and sys.platform == 'win32':
 else:
     compat_getpass = getpass.getpass
 
+try:
+    compat_input = raw_input
+except NameError:  # Python 3
+    compat_input = input
+
 # Python < 2.6.5 require kwargs to be bytes
 try:
     def _testfunc(x):