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
140355ba
Commit
140355ba
authored
Jan 10, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monkey: improve readability
parent
3fd5de56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
gevent/monkey.py
gevent/monkey.py
+6
-1
No files found.
gevent/monkey.py
View file @
140355ba
...
...
@@ -4,16 +4,19 @@ import sys
noisy
=
True
def
patch_os
():
from
gevent.hub
import
fork
import
os
os
.
fork
=
fork
def
patch_time
():
from
gevent.hub
import
sleep
_time
=
__import__
(
'time'
)
_time
.
sleep
=
sleep
def
patch_thread
():
from
gevent
import
thread
as
green_thread
thread
=
__import__
(
'thread'
)
...
...
@@ -34,6 +37,7 @@ def patch_thread():
elif
noisy
:
sys
.
stderr
.
write
(
"gevent.monkey's warning: '_threading_local' is already imported
\
n
\
n
"
)
def
patch_socket
(
dns
=
True
):
from
gevent.socket
import
socket
,
fromfd
,
wrap_ssl
,
socketpair
_socket
=
__import__
(
'socket'
)
...
...
@@ -44,6 +48,7 @@ def patch_socket(dns=True):
if
dns
:
patch_dns
()
def
patch_dns
():
from
gevent.socket
import
getaddrinfo
,
getnameinfo
,
gethostbyname
_socket
=
__import__
(
'socket'
)
...
...
@@ -79,7 +84,7 @@ def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=Tru
patch_ssl
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
modules
=
[
x
.
replace
(
'patch_'
,
''
)
for
x
in
globals
().
keys
()
if
x
.
startswith
(
'patch_'
)
and
x
!=
'patch_all'
]
script_help
=
"""gevent.monkey - monkey patch the standard modules to use gevent.
...
...
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