Daniel Carvalho has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/44105 )
Change subject: util: Fix cpt_upgrader
......................................................................
util: Fix cpt_upgrader
This had multiple issues related to the upgrade
to Python 3.
Change-Id: Iebac5618a05d7c3ad08b34652bf2ba08a82b5948
Signed-off-by: Daniel R. Carvalho <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44105
Maintainer: Bobby R. Bruce <[email protected]>
Tested-by: kokoro <[email protected]>
Reviewed-by: Gabe Black <[email protected]>
---
M util/cpt_upgrader.py
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved
Bobby R. Bruce: Looks good to me, approved
kokoro: Regressions pass
diff --git a/util/cpt_upgrader.py b/util/cpt_upgrader.py
index 15dc2ab..f1d7eb5 100755
--- a/util/cpt_upgrader.py
+++ b/util/cpt_upgrader.py
@@ -193,14 +193,14 @@
import shutil
shutil.copyfile(path, path + '.bak')
- cpt = configparser.SafeConfigParser()
+ cpt = configparser.ConfigParser()
# gem5 is case sensitive with paramaters
cpt.optionxform = str
# Read the current data
- cpt_file = file(path, 'r')
- cpt.readfp(cpt_file)
+ cpt_file = open(path, 'r')
+ cpt.read_file(cpt_file)
cpt_file.close()
change = False
@@ -257,7 +257,7 @@
# Write the old data back
verboseprint("...completed")
- cpt.write(file(path, 'w'))
+ cpt.write(open(path, 'w'))
if __name__ == '__main__':
from optparse import OptionParser, SUPPRESS_HELP
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44105
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: Iebac5618a05d7c3ad08b34652bf2ba08a82b5948
Gerrit-Change-Number: 44105
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s