From: Jakub Wilk Date: Sat, 14 May 2016 11:41:41 +0000 (+0200) Subject: Don't hardcode errno constant X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=66e7ace17a36ed0f761ae620801e9e27d5c3cb3f;p=youtube-dl.git Don't hardcode errno constant The value of ENOENT is architecture-dependent, so don't assume it's always 2. --- diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 03a6a1890..3917ca9dc 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -326,7 +326,7 @@ class YoutubeDL(object): ['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs) self._output_channel = os.fdopen(master, 'rb') except OSError as ose: - if ose.errno == 2: + if ose.errno == errno.ENOENT: self.report_warning('Could not find fribidi executable, ignoring --bidi-workaround . Make sure that fribidi is an executable file in one of the directories in your $PATH.') else: raise