From b88c711085c0179fcc706d6813f49b3f82714dbd Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 12 Nov 2015 23:49:22 -0500 Subject: minor changes to fix too many files open when trying to run with pypy --- bootstrap.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bootstrap.py') diff --git a/bootstrap.py b/bootstrap.py index f3bc1050..90917dcf 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -27,6 +27,8 @@ import os.path import sys import glob import subprocess +import filecmp +import shutil __doc__ = """bootstrap.py @@ -127,7 +129,7 @@ def main(): def must_copy(dst, src): if not os.path.exists(dst): return 1 - return open(dst, 'rb').read() != open(src, 'rb').read() + return filecmp.cmp(dst,src) # Note: We don't use the getopt module to process the command-line # arguments because we'd have to teach it about all of the SCons options. @@ -195,7 +197,8 @@ def main(): os.makedirs(dir) try: os.unlink(dst) except: pass - open(dst, 'wb').write( open(src, 'rb').read() ) + + shutil.copyfile(src,dst) if update_only: sys.exit(0) -- cgit v1.2.1