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
6dedfb11
Commit
6dedfb11
authored
Oct 19, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define the handle class the same way Py3.4 on windows does
parent
7d725628
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
gevent/subprocess.py
gevent/subprocess.py
+23
-3
No files found.
gevent/subprocess.py
View file @
6dedfb11
...
...
@@ -144,6 +144,26 @@ __all__ = __implements__ + __imports__
mswindows
=
sys
.
platform
==
'win32'
if
mswindows
:
import
msvcrt
if
PY3
:
class
Handle
(
int
):
closed
=
False
def
Close
(
self
):
if
not
self
.
closed
:
self
.
closed
=
True
_winapi
.
CloseHandle
(
self
)
def
Detach
(
self
):
if
not
self
.
closed
:
self
.
closed
=
True
return
int
(
self
)
raise
ValueError
(
"already closed"
)
def
__repr__
(
self
):
return
"Handle(%d)"
%
int
(
self
)
__del__
=
Close
__str__
=
__repr__
else
:
import
fcntl
import
pickle
...
...
@@ -647,7 +667,7 @@ class Popen(object):
p2cread
,
_
=
CreatePipe
(
None
,
0
)
if
PY3
:
p2cread
=
Handle
(
p2cread
)
CloseHandle
(
_
)
_winapi
.
CloseHandle
(
_
)
elif
stdin
==
PIPE
:
p2cread
,
p2cwrite
=
CreatePipe
(
None
,
0
)
if
PY3
:
...
...
@@ -667,7 +687,7 @@ class Popen(object):
_
,
c2pwrite
=
CreatePipe
(
None
,
0
)
if
PY3
:
c2pwrite
=
Handle
(
c2pwrite
)
CloseHandle
(
_
)
_winapi
.
CloseHandle
(
_
)
elif
stdout
==
PIPE
:
c2pread
,
c2pwrite
=
CreatePipe
(
None
,
0
)
if
PY3
:
...
...
@@ -687,7 +707,7 @@ class Popen(object):
_
,
errwrite
=
CreatePipe
(
None
,
0
)
if
PY3
:
errwrite
=
Handle
(
errwrite
)
CloseHandle
(
_
)
_winapi
.
CloseHandle
(
_
)
elif
stderr
==
PIPE
:
errread
,
errwrite
=
CreatePipe
(
None
,
0
)
if
PY3
:
...
...
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