File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -237,14 +237,12 @@ class NodeIpcIO():
237
237
_lines = 0
238
238
239
239
def __init__ (self , conn : multiprocessing .connection ._ConnectionBase ):
240
- self ._fd = conn .fileno ()
241
- self ._read = conn ._read # type: ignore
242
- self ._write = conn ._write # type: ignore
240
+ self ._conn = conn
243
241
244
242
# https://github.com/python/cpython/blob/330f1d58282517bdf1f19577ab9317fa9810bf95/Lib/multiprocessing/connection.py#L378-L392
245
243
def readline (self ) -> bytearray :
246
244
while self ._lines == 0 :
247
- chunk = self ._read (self ._fd , 65536 ) # type: bytes
245
+ chunk = self ._conn . _read (self ._conn . fileno () , 65536 ) # type: ignore
248
246
self ._buf += chunk
249
247
self ._lines += chunk .count (b'\n ' )
250
248
@@ -255,7 +253,7 @@ def readline(self) -> bytearray:
255
253
# https://github.com/python/cpython/blob/330f1d58282517bdf1f19577ab9317fa9810bf95/Lib/multiprocessing/connection.py#L369-L376
256
254
def write (self , data : bytes ) -> None :
257
255
while len (data ):
258
- n = self ._write (self ._fd , data ) # type: int
256
+ n = self ._conn . _write (self ._conn . fileno () , data ) # type: ignore
259
257
data = data [n :]
260
258
261
259
Original file line number Diff line number Diff line change 14
14
import contextlib
15
15
import fnmatch
16
16
import multiprocessing
17
- import multiprocessing .connection
18
17
import os
19
18
import posixpath
20
19
import socket
You can’t perform that action at this time.
0 commit comments