Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/41598 )
Change subject: python: Collapse away the now unused readCommandWithReturn
function.
......................................................................
python: Collapse away the now unused readCommandWithReturn function.
This had been used when detecting python versions, but can now be
absorbed into readCommand.
Change-Id: I4385357c3ce33a0f1b58e741067aa7ae3a7daa3b
---
M src/python/m5/util/__init__.py
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/src/python/m5/util/__init__.py b/src/python/m5/util/__init__.py
index 74c0ec0..a0fe63d 100644
--- a/src/python/m5/util/__init__.py
+++ b/src/python/m5/util/__init__.py
@@ -173,15 +173,15 @@
line += item
print(line)
-def readCommandWithReturn(cmd, **kwargs):
+def readCommand(cmd, **kwargs):
"""
run the command cmd, read the results and return them
this is sorta like `cmd` in shell
:param cmd: command to run with Popen
:type cmd: string, list
- :returns: pair consisting on Popen retcode and the command stdout
- :rtype: (int, string)
+ :returns: command stdout
+ :rtype: string
"""
from subprocess import Popen, PIPE, STDOUT
@@ -203,19 +203,7 @@
raise
output = subp.communicate()[0].decode('utf-8')
- return subp.returncode, output
-
-def readCommand(cmd, **kwargs):
- """
- run the command cmd, read the results and return them
- this is sorta like `cmd` in shell
-
- :param cmd: command to run with Popen
- :type cmd: string, list
- :returns: command stdout
- :rtype: string
- """
- return readCommandWithReturn(cmd, **kwargs)[1]
+ return output
def makeDir(path):
"""Make a directory if it doesn't exist. If the path does exist,
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41598
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I4385357c3ce33a0f1b58e741067aa7ae3a7daa3b
Gerrit-Change-Number: 41598
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s