FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythoncapi-compat/tests/utils.py at main · 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 (31 loc) · 857 Bytes
Breadcrumbs
pythoncapi-compat
/
tests
/
utils.py
Copy path
File metadata and controls
38 lines (31 loc) · 857 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
):
sys
.
stdout
.
flush
()
sys
.
stderr
.
flush
()
kw
[
'shell'
]
=
False
if
hasattr
(
subprocess
,
'run'
):
proc
=
subprocess
.
run
(
cmd
,
**
kw
)
else
:
proc
=
subprocess
.
Popen
(
cmd
,
**
kw
)
try
:
proc
.
communicate
()
proc
.
wait
()
except
:
proc
.
kill
()
proc
.
wait
()
raise
return
proc
def
run_command
(
cmd
,
**
kw
):
proc
=
_run_command
(
cmd
,
**
kw
)
exitcode
=
proc
.
returncode
if
exitcode
:
sys
.
exit
(
exitcode
)
def
get_output
(
cmd
,
**
kw
):
# Legacy for text=True
kw
[
'universal_newlines'
]
=
True
proc
=
_run_command
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
**
kw
)
return
(
proc
.
returncode
,
proc
.
stdout
)
Back
|
FazBrowse Home
|
New Git URL