1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-06-08 03:23:32 +08:00

_search_regex's "isatty" call fails with Py2exe's

_search_regex calls the sys.stderr.isatty() function for unix systems.

Py2exe uses a custom Stderr() stream which doesn't have an `isatty()`
function, leading to it's crash.

Fixes easily with checking that it's a unix system first.
This commit is contained in:
Itay Brandes
2013-12-14 17:40:51 +02:00
Unverified
parent 57bf4ce6d0
commit cf2b11eb09
+1 -1
View File
@@ -292,7 +292,7 @@ class InfoExtractor(object):
mobj = re.search(p, string, flags)
if mobj: break
if sys.stderr.isatty() and os.name != 'nt':
if os.name != 'nt' and sys.stderr.isatty():
_name = u'\033[0;34m%s\033[0m' % name
else:
_name = name