Commit 184bc929 authored by Denis Bilenko's avatar Denis Bilenko

rename FileObjectThreadPool -> FileObjectThread

parent 0a5df698
......@@ -13,7 +13,7 @@ except ImportError:
__all__ = ['FileObjectPosix',
'FileObjectThreadPool',
'FileObjectThread',
'FileObject']
......@@ -210,7 +210,7 @@ else:
FileObjectPosix.__del__ = UnboundMethodType(FileObjectPosix, None, noop)
class FileObjectThreadPool(object):
class FileObjectThread(object):
def __init__(self, fobj, *args, **kwargs):
self._close = kwargs.pop('close', True)
......@@ -220,7 +220,7 @@ class FileObjectThreadPool(object):
if isinstance(fobj, (int, long)):
if not self._close:
# we cannot do this, since fdopen object will close the descriptor
raise TypeError('FileObjectThreadPool does not support close=False')
raise TypeError('FileObjectThread does not support close=False')
fobj = os.fdopen(fobj, *args)
self._fobj = fobj
if self.threadpool is None:
......@@ -279,7 +279,7 @@ FileObjectClosed = IOError(EBADF, 'Bad file descriptor (FileObject was closed)')
try:
FileObject = FileObjectPosix
except NameError:
FileObject = FileObjectThreadPool
FileObject = FileObjectThread
class FileObjectBlock(object):
......@@ -307,7 +307,7 @@ class FileObjectBlock(object):
config = os.environ.get('GEVENT_FILE')
if config:
klass = {'thread': 'gevent.fileobject.FileObjectThreadPool',
klass = {'thread': 'gevent.fileobject.FileObjectThread',
'posix': 'gevent.fileobject.FileObjectPosix',
'block': 'gevent.fileobject.FileObjectBlock'}.get(config, config)
if klass.startswith('gevent.fileobject.'):
......
import os
import greentest
import gevent
from gevent.fileobject import FileObject, FileObjectThreadPool
from gevent.fileobject import FileObject, FileObjectThread
class Test(greentest.TestCase):
......@@ -26,7 +26,7 @@ class Test(greentest.TestCase):
def test_del_close(self):
self._test_del(close=True)
if FileObject is not FileObjectThreadPool:
if FileObject is not FileObjectThread:
def test_del_noclose(self):
r, w = os.pipe()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment