[Python-3000-checkins] r65688 - python/branches/py3k/Lib/io.py

antoine.pitrou python-3000-checkins at python.org
Fri Aug 15 02:06:00 CEST 2008


Author: antoine.pitrou
Date: Fri Aug 15 02:05:08 2008
New Revision: 65688

Log:
Fix build from a blank checkout by using the _thread module instead of threading in io.py
(thanks Christian!)



Modified:
   python/branches/py3k/Lib/io.py

Modified: python/branches/py3k/Lib/io.py
==============================================================================
--- python/branches/py3k/Lib/io.py	(original)
+++ python/branches/py3k/Lib/io.py	Fri Aug 15 02:05:08 2008
@@ -61,7 +61,7 @@
 import codecs
 import _fileio
 import warnings
-import threading
+from _thread import allocate_lock as Lock
 
 # open() uses st_blksize whenever we can
 DEFAULT_BUFFER_SIZE = 8 * 1024  # bytes
@@ -896,7 +896,7 @@
         _BufferedIOMixin.__init__(self, raw)
         self.buffer_size = buffer_size
         self._reset_read_buf()
-        self._read_lock = threading.Lock()
+        self._read_lock = Lock()
 
     def _reset_read_buf(self):
         self._read_buf = b""
@@ -1022,7 +1022,7 @@
                                 if max_buffer_size is None
                                 else max_buffer_size)
         self._write_buf = bytearray()
-        self._write_lock = threading.Lock()
+        self._write_lock = Lock()
 
     def write(self, b):
         if self.closed:


More information about the Python-3000-checkins mailing list