From a2889ef16dfaf27bbd83d076861884f47f0480ad Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 17 Apr 2011 13:57:03 -0700 Subject: [PATCH] file_types: Make code work in Python 2.4 --- util/file_types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 = [] -- 2.30.2