diff options
author | Nathan Binkert <nate@binkert.org> | 2011-04-17 13:57:03 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2011-04-17 13:57:03 -0700 |
commit | a2889ef16dfaf27bbd83d076861884f47f0480ad (patch) | |
tree | 211650fec4152b55addb95177850733c8ae170c0 | |
parent | 915f49ae9255372267aabe06e8c28c1fab8e43a5 (diff) | |
download | gem5-a2889ef16dfaf27bbd83d076861884f47f0480ad.tar.xz |
file_types: Make code work in Python 2.4
-rw-r--r-- | util/file_types.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/util/file_types.py b/util/file_types.py index 85e058db0..14d198bd6 100644 --- a/util/file_types.py +++ b/util/file_types.py @@ -140,7 +140,10 @@ def update_file(dst, src, language, mutator): if isinstance(src, str): # if a filename was provided, open the file - mode = 'r+' if inplace else 'r' + if inplace: + mode = 'r+' + else: + mode = 'r' src = file(src, mode) orig_lines = [] |