Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
205
Issues
205
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
a8476989
Commit
a8476989
authored
Jan 22, 2011
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix get_output_of_command. fixed
#2018
parent
7c531eee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
+2
-11
src/common.py
src/common.py
+2
-11
No files found.
src/common.py
View file @
a8476989
...
...
@@ -40,10 +40,7 @@ import hashlib
import
subprocess
import
curses
import
sys
import
select
import
errno
import
time
import
traceback
ROOM_STATE_NONE
=
11
ROOM_STATE_CURRENT
=
10
...
...
@@ -72,16 +69,10 @@ def get_output_of_command(command):
Runs a command and returns its output
"""
try
:
child_stdin
,
child_stdout
=
os
.
popen2
(
command
)
except
Value
Error
:
return
subprocess
.
check_output
(
command
.
split
()).
decode
(
'utf-8'
).
split
(
'
\n
'
)
except
subprocess
.
CalledProcess
Error
:
return
None
output
=
child_stdout
.
readlines
()
child_stdout
.
close
()
child_stdin
.
close
()
return
output
def
is_in_path
(
command
,
return_abs_path
=
False
):
"""
Return True if 'command' is found in one of the directories in the user's
...
...
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