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
3a77f445
Commit
3a77f445
authored
Aug 15, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only use fork() if it's available; fix GreenletExit import error introduced in the prev commit
parent
3841c6f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
gevent/__init__.py
gevent/__init__.py
+5
-1
gevent/hub.py
gevent/hub.py
+11
-5
No files found.
gevent/__init__.py
View file @
3a77f445
...
...
@@ -29,5 +29,9 @@ spawn_link = Greenlet.spawn_link
spawn_link_value
=
Greenlet
.
spawn_link_value
spawn_link_exception
=
Greenlet
.
spawn_link_exception
from
gevent.timeout
import
Timeout
,
with_timeout
from
gevent.hub
import
getcurrent
,
sleep
,
kill
,
signal
,
fork
,
shutdown
from
gevent.hub
import
getcurrent
,
GreenletExit
,
sleep
,
kill
,
signal
,
shutdown
try
:
from
gevent.hub
import
fork
except
ImportError
:
__all__
.
remove
(
'fork'
)
from
gevent.core
import
reinit
gevent/hub.py
View file @
3a77f445
...
...
@@ -26,7 +26,11 @@ thread = __import__('thread')
threadlocal
=
thread
.
_local
_threadlocal
=
threadlocal
()
_threadlocal
.
Hub
=
None
_original_fork
=
os
.
fork
try
:
_original_fork
=
os
.
fork
except
AttributeError
:
_original_fork
=
None
__all__
.
remove
(
'fork'
)
def
sleep
(
seconds
=
0
):
...
...
@@ -69,10 +73,12 @@ def signal(signalnum, handler, *args, **kwargs):
return
core
.
signal
(
signalnum
,
deliver_exception_to_MAIN
)
def
fork
():
result
=
_original_fork
()
core
.
reinit
()
return
result
if
_original_fork
is
not
None
:
def
fork
():
result
=
_original_fork
()
core
.
reinit
()
return
result
def
shutdown
():
...
...
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