浏览代码

Woooohooo! python3 youtube_dl BaW_jenozKc -t works!

Philipp Hagemeister 12 年之前
父节点
当前提交
0f00efed4c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/utils.py

+ 4 - 0
youtube_dl/utils.py

@@ -292,6 +292,10 @@ def encodeFilename(s):
 
 
 	assert type(s) == type(u'')
 	assert type(s) == type(u'')
 
 
+	# Python 3 has a Unicode API
+	if sys.version_info >= (3, 0):
+		return s
+
 	if sys.platform == 'win32' and sys.getwindowsversion()[0] >= 5:
 	if sys.platform == 'win32' and sys.getwindowsversion()[0] >= 5:
 		# Pass u'' directly to use Unicode APIs on Windows 2000 and up
 		# Pass u'' directly to use Unicode APIs on Windows 2000 and up
 		# (Detecting Windows NT 4 is tricky because 'major >= 4' would
 		# (Detecting Windows NT 4 is tricky because 'major >= 4' would