Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
184bc929
Commit
184bc929
authored
Sep 28, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename FileObjectThreadPool -> FileObjectThread
parent
0a5df698
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
gevent/fileobject.py
gevent/fileobject.py
+5
-5
greentest/test__fileobject.py
greentest/test__fileobject.py
+2
-2
No files found.
gevent/fileobject.py
View file @
184bc929
...
...
@@ -13,7 +13,7 @@ except ImportError:
__all__
=
[
'FileObjectPosix'
,
'FileObjectThread
Pool
'
,
'FileObjectThread'
,
'FileObject'
]
...
...
@@ -210,7 +210,7 @@ else:
FileObjectPosix
.
__del__
=
UnboundMethodType
(
FileObjectPosix
,
None
,
noop
)
class
FileObjectThread
Pool
(
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
(
'FileObjectThread
Pool
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
=
FileObjectThread
Pool
FileObject
=
FileObjectThread
class
FileObjectBlock
(
object
):
...
...
@@ -307,7 +307,7 @@ class FileObjectBlock(object):
config
=
os
.
environ
.
get
(
'GEVENT_FILE'
)
if
config
:
klass
=
{
'thread'
:
'gevent.fileobject.FileObjectThread
Pool
'
,
klass
=
{
'thread'
:
'gevent.fileobject.FileObjectThread'
,
'posix'
:
'gevent.fileobject.FileObjectPosix'
,
'block'
:
'gevent.fileobject.FileObjectBlock'
}.
get
(
config
,
config
)
if
klass
.
startswith
(
'gevent.fileobject.'
):
...
...
greentest/test__fileobject.py
View file @
184bc929
import
os
import
greentest
import
gevent
from
gevent.fileobject
import
FileObject
,
FileObjectThread
Pool
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
FileObjectThread
Pool
:
if
FileObject
is
not
FileObjectThread
:
def
test_del_noclose
(
self
):
r
,
w
=
os
.
pipe
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment