diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-03-13 15:02:49 +0000 |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-03-13 15:02:49 +0000 |
commit | 2ad1a5a8166d4c4449dd5e111c7d63e16616fa1b (patch) | |
tree | 1d0f23412abf8dcf38513c54410a3bf78ba4f54e /src/script | |
parent | a7576d9d63fef6f91124feb25e1c4f3ea3496d91 (diff) | |
parent | 63f4c3b24e101450ae1dcb39aa7e1c68ffc997d3 (diff) | |
download | scons-2ad1a5a8166d4c4449dd5e111c7d63e16616fa1b.tar.gz |
Merged in rodrigc/scons (pull request #409)
Remove 'U' flag to open()
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/scons-configure-cache.py | 10 | ||||
-rw-r--r-- | src/script/scons-time.py | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/script/scons-configure-cache.py b/src/script/scons-configure-cache.py index 2648acda..0fc7b48a 100644 --- a/src/script/scons-configure-cache.py +++ b/src/script/scons-configure-cache.py @@ -23,6 +23,8 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +from __future__ import print_function + __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" __version__ = "__VERSION__" @@ -41,14 +43,14 @@ import json import os def rearrange_cache_entries(current_prefix_len, new_prefix_len): - print 'Changing prefix length from', current_prefix_len, 'to', new_prefix_len + print('Changing prefix length from', current_prefix_len, 'to', new_prefix_len) dirs = set() old_dirs = set() for file in glob.iglob(os.path.join('*', '*')): name = os.path.basename(file) dir = name[:current_prefix_len].upper() if dir not in old_dirs: - print 'Migrating', dir + print('Migrating', dir) old_dirs.add(dir) dir = name[:new_prefix_len].upper() if dir not in dirs: @@ -99,7 +101,7 @@ for param in config_entries: parser.add_argument('--version', action='version', version='%(prog)s 1.0') # Get the command line as a dict without any of the unspecified entries. -args = dict([x for x in list(vars(parser.parse_args()).items()) if x[1]]) +args = dict([x for x in vars(parser.parse_args()).items() if x[1]]) # It seems somewhat strange to me, but positional arguments don't get the - # in the name changed to _, whereas optional arguments do... @@ -136,4 +138,4 @@ for key in args: # and write the updated config file with open('config', 'w') as conf: - json.dump(config, conf)
\ No newline at end of file + json.dump(config, conf) diff --git a/src/script/scons-time.py b/src/script/scons-time.py index b4db35f3..aa875f14 100644 --- a/src/script/scons-time.py +++ b/src/script/scons-time.py @@ -654,7 +654,7 @@ class SConsTimer(object): sys.stderr.write('%s Cannot use the "func" subcommand.\n' % self.name_spaces) sys.exit(1) statistics = pstats.Stats(file).stats - matches = [ e for e in list(statistics.items()) if e[0][2] == function ] + matches = [ e for e in statistics.items() if e[0][2] == function ] r = matches[0] return r[0][0], r[0][1], r[0][2], r[1][3] |