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
0ebd48e3
Commit
0ebd48e3
authored
Sep 10, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monkey: avoid spurious warnings
parent
a58a8202
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
gevent/monkey.py
gevent/monkey.py
+16
-15
No files found.
gevent/monkey.py
View file @
0ebd48e3
...
...
@@ -15,23 +15,24 @@ def patch_time():
_time
.
sleep
=
sleep
def
patch_thread
():
if
noisy
and
'threading'
in
sys
.
modules
:
sys
.
stderr
.
write
(
"gevent.monkey's warning: 'threading' is already imported
\
n
\
n
"
)
from
gevent
import
thread
as
green_thread
thread
=
__import__
(
'thread'
)
thread
.
get_ident
=
green_thread
.
get_ident
thread
.
start_new_thread
=
green_thread
.
start_new_thread
thread
.
LockType
=
green_thread
.
LockType
thread
.
allocate_lock
=
green_thread
.
allocate_lock
thread
.
exit
=
green_thread
.
exit
if
hasattr
(
green_thread
,
'stack_size'
):
thread
.
stack_size
=
green_thread
.
stack_size
# built-in thread._local object won't work as greenlet-local
if
'_threading_local'
not
in
sys
.
modules
:
import
_threading_local
thread
.
_local
=
_threading_local
.
local
elif
noisy
:
sys
.
stderr
.
write
(
"gevent.monkey's warning: '_threading_local' is already imported
\
n
\
n
"
)
if
thread
.
exit
is
not
green_thread
.
exit
:
thread
.
get_ident
=
green_thread
.
get_ident
thread
.
start_new_thread
=
green_thread
.
start_new_thread
thread
.
LockType
=
green_thread
.
LockType
thread
.
allocate_lock
=
green_thread
.
allocate_lock
thread
.
exit
=
green_thread
.
exit
if
hasattr
(
green_thread
,
'stack_size'
):
thread
.
stack_size
=
green_thread
.
stack_size
if
noisy
and
'threading'
in
sys
.
modules
:
sys
.
stderr
.
write
(
"gevent.monkey's warning: 'threading' is already imported
\
n
\
n
"
)
# built-in thread._local object won't work as greenlet-local
if
'_threading_local'
not
in
sys
.
modules
:
import
_threading_local
thread
.
_local
=
_threading_local
.
local
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
GreenSocket
,
fromfd
,
wrap_ssl
,
socketpair
...
...
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