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
e1f11c00
Commit
e1f11c00
authored
May 12, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused greentest/mysubprocess.py
parent
2f24633a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
58 deletions
+0
-58
greentest/mysubprocess.py
greentest/mysubprocess.py
+0
-58
No files found.
greentest/mysubprocess.py
deleted
100644 → 0
View file @
2f24633a
import
sys
import
os
import
subprocess
import
signal
from
subprocess
import
PIPE
,
STDOUT
class
Popen
(
subprocess
.
Popen
):
def
send_signal
(
self
,
sig
):
if
sys
.
platform
==
'win32'
:
sig
=
signal
.
SIGTERM
if
hasattr
(
subprocess
.
Popen
,
'send_signal'
):
try
:
return
subprocess
.
Popen
.
send_signal
(
self
,
sig
)
except
Exception
:
ex
=
sys
.
exc_info
()[
1
]
sys
.
stderr
.
write
(
'send_signal(%s, %s) failed: %s
\
n
'
%
(
self
.
pid
,
sig
,
ex
))
self
.
external_kill
(
str
(
ex
))
else
:
if
hasattr
(
os
,
'kill'
):
sys
.
stderr
.
write
(
'Sending signal %s to %s
\
n
'
%
(
sig
,
self
.
pid
))
try
:
os
.
kill
(
self
.
pid
,
sig
)
except
Exception
:
ex
=
sys
.
exc_info
()[
1
]
sys
.
stderr
.
write
(
'Error while killing %s: %s
\
n
'
%
(
self
.
pid
,
ex
))
self
.
external_kill
()
else
:
self
.
external_kill
()
if
not
hasattr
(
subprocess
.
Popen
,
'kill'
):
def
kill
(
self
):
return
self
.
send_signal
(
getattr
(
signal
,
'SIGTERM'
,
15
))
if
not
hasattr
(
subprocess
.
Popen
,
'terminate'
):
def
terminate
(
self
):
return
self
.
send_signal
(
getattr
(
signal
,
'SIGTERM'
,
9
))
def
interrupt
(
self
):
sig
=
getattr
(
signal
,
'SIGINT'
,
2
)
return
self
.
send_signal
(
sig
)
def
external_kill
(
self
,
reason
=
''
):
if
sys
.
platform
==
'win32'
:
sys
.
stderr
.
write
(
'Killing %s: %s
\
n
'
%
(
self
.
pid
,
reason
))
os
.
system
(
'taskkill /f /pid %s'
%
self
.
pid
)
else
:
sys
.
stderr
.
write
(
'Cannot kill on this platform. Please kill %s
\
n
'
%
self
.
pid
)
def
gevent_wait
(
self
):
from
gevent
import
sleep
while
True
:
if
self
.
poll
()
is
not
None
:
return
self
.
poll
()
sleep
(
0.1
)
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