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
f7953f59
Commit
f7953f59
authored
Oct 17, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test__socketpair under py2.
parent
ceda02df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
gevent/_socket2.py
gevent/_socket2.py
+18
-1
known_failures.py
known_failures.py
+0
-1
No files found.
gevent/_socket2.py
View file @
f7953f59
...
...
@@ -29,7 +29,24 @@ except AttributeError:
'setsockopt'
,
'sendall'
,
'setblocking'
,
'settimeout'
,
'gettimeout'
,
'shutdown'
)
else
:
# Python 2 doesn't natively support with statements on _fileobject;
# but it eases our test cases if we can do the same with on both Py3
# and Py2. Implementation copied from Python 3
if
not
hasattr
(
_fileobject
,
'__enter__'
):
# we could either patch in place:
#_fileobject.__enter__ = lambda self: self
#_fileobject.__exit__ = lambda self, *args: self.close() if not self.closed else None
# or we could subclass. subclassing has the benefit of not
# changing the behaviour of the stdlib if we're just imported
class
_fileobject
(
_fileobject
):
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
*
args
):
if
not
self
.
closed
:
self
.
close
()
if
sys
.
version_info
[:
2
]
<
(
2
,
7
):
_get_memory
=
buffer
...
...
known_failures.py
View file @
f7953f59
...
...
@@ -77,7 +77,6 @@ if sys.platform == 'win32':
'test__socketpair.py'
,
]
if
struct
.
calcsize
(
'P'
)
*
8
==
64
:
# could be a problem of appveyor - not sure
# ======================================================================
...
...
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