Browse Source

Merge pull request #9493 from jwilk/errno

Don't hardcode errno constant
Yen Chi Hsuan 9 năm trước cách đây
mục cha
commit
707bb426b1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      youtube_dl/YoutubeDL.py

+ 1 - 1
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