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
c90621c7
Commit
c90621c7
authored
May 05, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
subprocess: remove useless code
parent
bd77ef3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
19 deletions
+8
-19
gevent/subprocess.py
gevent/subprocess.py
+8
-19
No files found.
gevent/subprocess.py
View file @
c90621c7
...
...
@@ -367,20 +367,13 @@ class Popen(object):
self
.
pid
=
pid
ht
.
Close
()
def
_internal_poll
(
self
,
_deadstate
=
None
,
_WaitForSingleObject
=
_subprocess
.
WaitForSingleObject
,
_WAIT_OBJECT_0
=
_subprocess
.
WAIT_OBJECT_0
,
_GetExitCodeProcess
=
_subprocess
.
GetExitCodeProcess
):
def
_internal_poll
(
self
):
"""Check if child process has terminated. Returns returncode
attribute.
This method is called by __del__, so it can only refer to objects
in its local scope.
"""
if
self
.
returncode
is
None
:
if
_
WaitForSingleObject
(
self
.
_handle
,
0
)
==
_WAIT_OBJECT_0
:
self
.
returncode
=
_GetExitCodeProcess
(
self
.
_handle
)
if
_
subprocess
.
WaitForSingleObject
(
self
.
_handle
,
0
)
==
_subprocess
.
_WAIT_OBJECT_0
:
self
.
returncode
=
_
subprocess
.
GetExitCodeProcess
(
self
.
_handle
)
return
self
.
returncode
...
...
@@ -623,15 +616,11 @@ class Popen(object):
raise
child_exception
def
_handle_exitstatus
(
self
,
sts
,
_WIFSIGNALED
=
os
.
WIFSIGNALED
,
_WTERMSIG
=
os
.
WTERMSIG
,
_WIFEXITED
=
os
.
WIFEXITED
,
_WEXITSTATUS
=
os
.
WEXITSTATUS
):
# This method is called (indirectly) by __del__, so it cannot
# refer to anything outside of its local scope."""
if
_WIFSIGNALED
(
sts
):
self
.
returncode
=
-
_WTERMSIG
(
sts
)
elif
_WIFEXITED
(
sts
):
self
.
returncode
=
_WEXITSTATUS
(
sts
)
def
_handle_exitstatus
(
self
,
sts
):
if
os
.
WIFSIGNALED
(
sts
):
self
.
returncode
=
-
os
.
WTERMSIG
(
sts
)
elif
os
.
WIFEXITED
(
sts
):
self
.
returncode
=
os
.
WEXITSTATUS
(
sts
)
else
:
# Should never happen
raise
RuntimeError
(
"Unknown child exit status!"
)
...
...
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