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):
...
@@ -367,20 +367,13 @@ class Popen(object):
self
.
pid
=
pid
self
.
pid
=
pid
ht
.
Close
()
ht
.
Close
()
def
_internal_poll
(
self
,
_deadstate
=
None
,
def
_internal_poll
(
self
):
_WaitForSingleObject
=
_subprocess
.
WaitForSingleObject
,
_WAIT_OBJECT_0
=
_subprocess
.
WAIT_OBJECT_0
,
_GetExitCodeProcess
=
_subprocess
.
GetExitCodeProcess
):
"""Check if child process has terminated. Returns returncode
"""Check if child process has terminated. Returns returncode
attribute.
attribute.
This method is called by __del__, so it can only refer to objects
in its local scope.
"""
"""
if
self
.
returncode
is
None
:
if
self
.
returncode
is
None
:
if
_
WaitForSingleObject
(
self
.
_handle
,
0
)
==
_WAIT_OBJECT_0
:
if
_
subprocess
.
WaitForSingleObject
(
self
.
_handle
,
0
)
==
_subprocess
.
_WAIT_OBJECT_0
:
self
.
returncode
=
_GetExitCodeProcess
(
self
.
_handle
)
self
.
returncode
=
_
subprocess
.
GetExitCodeProcess
(
self
.
_handle
)
return
self
.
returncode
return
self
.
returncode
...
@@ -623,15 +616,11 @@ class Popen(object):
...
@@ -623,15 +616,11 @@ class Popen(object):
raise
child_exception
raise
child_exception
def
_handle_exitstatus
(
self
,
sts
,
_WIFSIGNALED
=
os
.
WIFSIGNALED
,
def
_handle_exitstatus
(
self
,
sts
):
_WTERMSIG
=
os
.
WTERMSIG
,
_WIFEXITED
=
os
.
WIFEXITED
,
if
os
.
WIFSIGNALED
(
sts
):
_WEXITSTATUS
=
os
.
WEXITSTATUS
):
self
.
returncode
=
-
os
.
WTERMSIG
(
sts
)
# This method is called (indirectly) by __del__, so it cannot
elif
os
.
WIFEXITED
(
sts
):
# refer to anything outside of its local scope."""
self
.
returncode
=
os
.
WEXITSTATUS
(
sts
)
if
_WIFSIGNALED
(
sts
):
self
.
returncode
=
-
_WTERMSIG
(
sts
)
elif
_WIFEXITED
(
sts
):
self
.
returncode
=
_WEXITSTATUS
(
sts
)
else
:
else
:
# Should never happen
# Should never happen
raise
RuntimeError
(
"Unknown child exit status!"
)
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