summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Variables/VariablesTests.py3
-rw-r--r--src/engine/SCons/Variables/__init__.py2
-rw-r--r--src/engine/SCons/compat/_scons_optparse.py2
-rw-r--r--src/script/scons-time.py10
4 files changed, 8 insertions, 9 deletions
diff --git a/src/engine/SCons/Variables/VariablesTests.py b/src/engine/SCons/Variables/VariablesTests.py
index f1caff7..7f49692 100644
--- a/src/engine/SCons/Variables/VariablesTests.py
+++ b/src/engine/SCons/Variables/VariablesTests.py
@@ -23,7 +23,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import string
import sys
import unittest
import TestSCons
@@ -54,7 +53,7 @@ def check(key, value, env):
def checkSave(file, expected):
gdict = {}
ldict = {}
- exec string.replace(open(file).read(), '\r', '\n') in gdict, ldict
+ exec open(file, 'rU').read() in gdict, ldict
assert expected == ldict, "%s\n...not equal to...\n%s" % (expected, ldict)
class VariablesTestCase(unittest.TestCase):
diff --git a/src/engine/SCons/Variables/__init__.py b/src/engine/SCons/Variables/__init__.py
index 3cc6694..805471a 100644
--- a/src/engine/SCons/Variables/__init__.py
+++ b/src/engine/SCons/Variables/__init__.py
@@ -166,7 +166,7 @@ class Variables:
sys.path.insert(0, dir)
try:
values['__name__'] = filename
- exec string.replace(open(filename).read(), '\r', '\n') in {}, values
+ exec open(filename, 'rU').read() in {}, values
finally:
if dir:
del sys.path[0]
diff --git a/src/engine/SCons/compat/_scons_optparse.py b/src/engine/SCons/compat/_scons_optparse.py
index 23f2ad3..219adba 100644
--- a/src/engine/SCons/compat/_scons_optparse.py
+++ b/src/engine/SCons/compat/_scons_optparse.py
@@ -920,7 +920,7 @@ class Values:
def read_file(self, filename, mode="careful"):
vars = {}
- exec string.replace(open(filename).read(), '\r', '\n') in vars
+ exec open(filename, 'rU').read() in vars
self._update(vars, mode)
def ensure_value(self, attr, value):
diff --git a/src/script/scons-time.py b/src/script/scons-time.py
index 019df31..6e18892 100644
--- a/src/script/scons-time.py
+++ b/src/script/scons-time.py
@@ -841,7 +841,7 @@ class SConsTimer:
self.title = a
if self.config_file:
- exec string.replace(open(self.config_file).read(), '\r', '\n') in self.__dict__
+ exec open(self.config_file, 'rU').read() in self.__dict__
if self.chdir:
os.chdir(self.chdir)
@@ -960,7 +960,7 @@ class SConsTimer:
self.title = a
if self.config_file:
- HACK_for_exec(string.replace(open(self.config_file).read(), '\r', '\n'), self.__dict__)
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
if self.chdir:
os.chdir(self.chdir)
@@ -1080,7 +1080,7 @@ class SConsTimer:
object_name = args.pop(0)
if self.config_file:
- HACK_for_exec(string.replace(open(self.config_file).read(), '\r', '\n'), self.__dict__)
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
if self.chdir:
os.chdir(self.chdir)
@@ -1218,7 +1218,7 @@ class SConsTimer:
sys.exit(1)
if self.config_file:
- exec string.replace(open(self.config_file).read(), '\r', '\n') in self.__dict__
+ exec open(self.config_file, 'rU').read() in self.__dict__
if args:
self.archive_list = args
@@ -1458,7 +1458,7 @@ class SConsTimer:
which = a
if self.config_file:
- HACK_for_exec(string.replace(open(self.config_file).read(), '\r', '\n'), self.__dict__)
+ HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__)
if self.chdir:
os.chdir(self.chdir)