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
a6f8df1f
Commit
a6f8df1f
authored
Dec 09, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #214 from op/monkey-module-invocation
Fixed bug in --module argument for gevent.monkey
parents
23e40c75
090efdf5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
gevent/monkey.py
gevent/monkey.py
+8
-3
No files found.
gevent/monkey.py
View file @
a6f8df1f
...
...
@@ -198,7 +198,9 @@ def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=Tru
if
__name__
==
'__main__'
:
modules
=
[
x
.
replace
(
'patch_'
,
''
)
for
x
in
globals
().
keys
()
if
x
.
startswith
(
'patch_'
)
and
x
!=
'patch_all'
]
from
inspect
import
getargspec
patch_all_args
=
getargspec
(
patch_all
)[
0
]
modules
=
[
x
for
x
in
patch_all_args
if
'patch_'
+
x
in
globals
()]
script_help
=
"""gevent.monkey - monkey patch the standard modules to use gevent.
USAGE: python -m gevent.monkey [MONKEY OPTIONS] script [SCRIPT OPTIONS]
...
...
@@ -216,10 +218,13 @@ MONKEY OPTIONS: --verbose %s""" % ', '.join('--[no-]%s' % m for m in modules)
option
=
argv
[
0
][
2
:]
if
option
==
'verbose'
:
verbose
=
True
elif
option
.
startswith
(
'no-'
)
and
option
.
replace
(
'no-'
,
''
)
in
module
s
:
elif
option
.
startswith
(
'no-'
)
and
option
.
replace
(
'no-'
,
''
)
in
patch_all_arg
s
:
args
[
option
[
3
:]]
=
False
elif
option
not
in
module
s
:
elif
option
in
patch_all_arg
s
:
args
[
option
]
=
True
if
option
in
modules
:
for
module
in
modules
:
args
.
setdefault
(
module
,
False
)
else
:
sys
.
exit
(
script_help
+
'
\
n
\
n
'
+
'Cannot patch %r'
%
option
)
del
argv
[
0
]
...
...
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