mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
...
This commit is contained in:
parent
ec3692fec4
commit
eb0aa151fb
@ -11,7 +11,7 @@ from io import DEFAULT_BUFFER_SIZE
|
|||||||
from select import select
|
from select import select
|
||||||
|
|
||||||
from calibre.constants import iswindows, isosx
|
from calibre.constants import iswindows, isosx
|
||||||
from calibre.utils.ipc import eintr_retry_call
|
from calibre.srv.utils import eintr_retry_call
|
||||||
|
|
||||||
def file_metadata(fileobj):
|
def file_metadata(fileobj):
|
||||||
try:
|
try:
|
||||||
|
@ -165,3 +165,12 @@ def create_sock_pair(port=0):
|
|||||||
client_sock.setblocking(True)
|
client_sock.setblocking(True)
|
||||||
|
|
||||||
return client_sock, srv_sock
|
return client_sock, srv_sock
|
||||||
|
|
||||||
|
def eintr_retry_call(func, *args, **kwargs):
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
return func(*args, **kwargs)
|
||||||
|
except EnvironmentError as e:
|
||||||
|
if getattr(e, 'errno', None) in socket_error_eintr:
|
||||||
|
continue
|
||||||
|
raise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user