diff options
author | Itay Brandes <Brandes.Itay@gmail.com> | 2013-12-14 17:40:51 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-16 21:50:26 +0100 |
commit | 87a28127d225f698c3cbf77a7f943338a3499d6e (patch) | |
tree | 23be0878175415a74a941be87871fe737c5f84d5 /youtube_dl/extractor/common.py | |
parent | ebce53b3d85bc5c099b4fd0ca27d03034d7024ea (diff) |
_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.
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 11b6ed524..1fc0624a3 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -295,7 +295,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 |