def blocking(self):
'''
Allow temporary access to the underlying file in blocking mode
'''
if self._buffer:
raise IOError('There is unread buffered data.')
try:
os.set_blocking(int(self._fileno), True)
yield self._file
finally:
os.set_blocking(int(self._fileno), False)
评论列表
文章目录