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
c8ddd6b0
Commit
c8ddd6b0
authored
Dec 26, 2013
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #353 from fantix/fix_exec
Fixed exec, refs #38.
parents
f250fa9f
735026d4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
gevent/fileobject.py
gevent/fileobject.py
+2
-2
greentest/monkey_test.py
greentest/monkey_test.py
+1
-1
greentest/test__all__.py
greentest/test__all__.py
+3
-2
greentest/test_threading_2.py
greentest/test_threading_2.py
+1
-1
No files found.
gevent/fileobject.py
View file @
c8ddd6b0
...
@@ -261,12 +261,12 @@ class FileObjectThread(object):
...
@@ -261,12 +261,12 @@ class FileObjectThread(object):
for
method
in
[
'read'
,
'readinto'
,
'readline'
,
'readlines'
,
'write'
,
'writelines'
,
'xreadlines'
]:
for
method
in
[
'read'
,
'readinto'
,
'readline'
,
'readlines'
,
'write'
,
'writelines'
,
'xreadlines'
]:
exec
'''def %s(self, *args, **kwargs):
exec
(
'''def %s(self, *args, **kwargs):
fobj = self._fobj
fobj = self._fobj
if fobj is None:
if fobj is None:
raise FileObjectClosed
raise FileObjectClosed
return self._apply(fobj.%s, args, kwargs)
return self._apply(fobj.%s, args, kwargs)
'''
%
(
method
,
method
)
'''
%
(
method
,
method
)
)
def
__iter__
(
self
):
def
__iter__
(
self
):
return
self
return
self
...
...
greentest/monkey_test.py
View file @
c8ddd6b0
...
@@ -30,4 +30,4 @@ test_name = os.path.splitext(test_filename)[0]
...
@@ -30,4 +30,4 @@ test_name = os.path.splitext(test_filename)[0]
module_source
=
open
(
test_filename
).
read
()
module_source
=
open
(
test_filename
).
read
()
module_source
=
disable_tests_in_source
(
module_source
,
test_name
)
module_source
=
disable_tests_in_source
(
module_source
,
test_name
)
module_code
=
compile
(
module_source
,
test_filename
,
'exec'
)
module_code
=
compile
(
module_source
,
test_filename
,
'exec'
)
exec
module_code
in
globals
(
)
exec
(
module_code
,
globals
()
)
greentest/test__all__.py
View file @
c8ddd6b0
"""Check __all__, __implements__, __extensions__, __imports__ of the modules"""
"""Check __all__, __implements__, __extensions__, __imports__ of the modules"""
from
__future__
import
print_function
from
__future__
import
print_function
import
six
import
sys
import
sys
import
unittest
import
unittest
import
types
import
types
...
@@ -43,7 +44,7 @@ class Test(unittest.TestCase):
...
@@ -43,7 +44,7 @@ class Test(unittest.TestCase):
assert
self
.
modname
in
NO_ALL
assert
self
.
modname
in
NO_ALL
return
return
names
=
{}
names
=
{}
exec
(
"from %s import *"
%
self
.
modname
)
in
names
six
.
exec_
(
"from %s import *"
%
self
.
modname
,
names
)
names
.
pop
(
'__builtins__'
,
None
)
names
.
pop
(
'__builtins__'
,
None
)
self
.
assertEqual
(
sorted
(
names
),
sorted
(
self
.
module
.
__all__
))
self
.
assertEqual
(
sorted
(
names
),
sorted
(
self
.
module
.
__all__
))
...
@@ -140,7 +141,7 @@ are missing from %r:
...
@@ -140,7 +141,7 @@ are missing from %r:
def
_test
(
self
,
modname
):
def
_test
(
self
,
modname
):
self
.
modname
=
modname
self
.
modname
=
modname
exec
"import %s"
%
modname
in
{}
six
.
exec_
(
"import %s"
%
modname
,
{})
self
.
module
=
sys
.
modules
[
modname
]
self
.
module
=
sys
.
modules
[
modname
]
self
.
check_all
()
self
.
check_all
()
...
...
greentest/test_threading_2.py
View file @
c8ddd6b0
...
@@ -24,7 +24,7 @@ if not hasattr(threading._Condition, 'notify_all'):
...
@@ -24,7 +24,7 @@ if not hasattr(threading._Condition, 'notify_all'):
threading._Condition.notify_all = threading._Condition.notifyAll
threading._Condition.notify_all = threading._Condition.notifyAll
'''
'''
exec
setup_
exec
(
setup_
)
setup_3
=
'
\
n
'
.
join
(
' %s'
%
line
for
line
in
setup_
.
split
(
'
\
n
'
))
setup_3
=
'
\
n
'
.
join
(
' %s'
%
line
for
line
in
setup_
.
split
(
'
\
n
'
))
setup_4
=
'
\
n
'
.
join
(
' %s'
%
line
for
line
in
setup_
.
split
(
'
\
n
'
))
setup_4
=
'
\
n
'
.
join
(
' %s'
%
line
for
line
in
setup_
.
split
(
'
\
n
'
))
...
...
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