FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythoncapi-compat/tests/utils.py at debug · python/pythoncapi-compat · GitHub
python
pythoncapi-compat
Repository navigation
Code
Issues
1
(1)
Pull requests
1
(1)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythoncapi-compat
/
tests
/
utils.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (33 loc) · 897 Bytes
Breadcrumbs
pythoncapi-compat
/
tests
/
utils.py
Copy path
File metadata and controls
38 lines (33 loc) · 897 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import
subprocess
import
sys
def
run_command
(
cmd
,
**
kw
):
if
hasattr
(
subprocess
,
'run'
):
proc
=
subprocess
.
run
(
cmd
,
**
kw
)
else
:
kw
[
'shell'
]
=
False
proc
=
subprocess
.
Popen
(
cmd
,
**
kw
)
try
:
proc
.
wait
()
except
:
proc
.
kill
()
proc
.
wait
()
raise
exitcode
=
proc
.
returncode
if
exitcode
:
sys
.
exit
(
exitcode
)
def
command_stdout
(
cmd
,
**
kw
):
kw
[
'stdout'
]
=
subprocess
.
PIPE
kw
[
'universal_newlines'
]
=
True
if
hasattr
(
subprocess
,
'run'
):
proc
=
subprocess
.
run
(
cmd
,
**
kw
)
return
(
proc
.
returncode
,
proc
.
stdout
)
else
:
kw
[
'shell'
]
=
False
proc
=
subprocess
.
Popen
(
cmd
,
**
kw
)
try
:
stdout
=
proc
.
communicate
()[
0
]
except
:
proc
.
kill
()
proc
.
wait
()
raise
return
(
proc
.
returncode
,
stdout
)
Back
|
FazBrowse Home
|
New Git URL