Py2 compatibility for `FileNotFoundError`

pull/275/head
pukkandan 2021-04-26 07:22:24 +05:30
rodzic 6b1d8c1e30
commit 88728713c8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0F00D95A001F4698
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -1,5 +1,6 @@
from __future__ import unicode_literals
import errno
try:
import concurrent.futures
can_threaded_download = True
@ -126,7 +127,10 @@ class DashSegmentsFD(FragmentFD):
file.close()
self._append_fragment(ctx, frag_content)
return True
except FileNotFoundError:
except EnvironmentError as ose:
if ose.errno != errno.ENOENT:
raise
# FileNotFoundError
if skip_unavailable_fragments:
self.report_skip_fragment(frag_index)
return True

Wyświetl plik

@ -1,5 +1,6 @@
from __future__ import unicode_literals
import errno
import re
import binascii
try:
@ -316,7 +317,10 @@ class HlsFD(FragmentFD):
file.close()
self._append_fragment(ctx, frag_content)
return True
except FileNotFoundError:
except EnvironmentError as ose:
if ose.errno != errno.ENOENT:
raise
# FileNotFoundError
if skip_unavailable_fragments:
self.report_skip_fragment(frag_index)
return True