diff options
| author | Greg Noel <GregNoel@tigris.org> | 2009-03-08 00:51:26 (GMT) |
|---|---|---|
| committer | Greg Noel <GregNoel@tigris.org> | 2009-03-08 00:51:26 (GMT) |
| commit | 7f380de2d31a8ca288bd8a44a51de8f2867830be (patch) | |
| tree | beffc7420a3c8681158aeefa6b82628fa7121aca /src | |
| parent | 4993b28ca2ef767ede531e21450f390683da6b66 (diff) | |
| download | SCons-7f380de2d31a8ca288bd8a44a51de8f2867830be.zip SCons-7f380de2d31a8ca288bd8a44a51de8f2867830be.tar.gz SCons-7f380de2d31a8ca288bd8a44a51de8f2867830be.tar.bz2 | |
Issue 2326, change execfile() to exec ... (FIXED)
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/SCons/Variables/VariablesTests.py | 3 | ||||
| -rw-r--r-- | src/engine/SCons/Variables/__init__.py | 2 | ||||
| -rw-r--r-- | src/engine/SCons/compat/_scons_optparse.py | 2 | ||||
| -rw-r--r-- | src/script/scons-time.py | 10 |
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) |
