Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1e48ea

Browse files
committed
Fix build from a blank checkout by using the _thread module instead of threading in io.py
(thanks Christian!)
1 parent 8769576 commit e1e48ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/io.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
import codecs
6262
import _fileio
6363
import warnings
64-
import threading
64+
from _thread import allocate_lock as Lock
6565

6666
# open() uses st_blksize whenever we can
6767
DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes
@@ -896,7 +896,7 @@ def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
896896
_BufferedIOMixin.__init__(self, raw)
897897
self.buffer_size = buffer_size
898898
self._reset_read_buf()
899-
self._read_lock = threading.Lock()
899+
self._read_lock = Lock()
900900

901901
def _reset_read_buf(self):
902902
self._read_buf = b""
@@ -1022,7 +1022,7 @@ def __init__(self, raw,
10221022
if max_buffer_size is None
10231023
else max_buffer_size)
10241024
self._write_buf = bytearray()
1025-
self._write_lock = threading.Lock()
1025+
self._write_lock = Lock()
10261026

10271027
def write(self, b):
10281028
if self.closed:

0 commit comments

Comments
 (0)