Rollup merge of #58489 - xfix:fix-keyword-tests-runtime-error, r=alexcrichton

Fix runtime error in generate-keyword-tests

The script was made unusable after removing license headers.
This commit is contained in:
kennytm 2019-02-16 00:56:04 +08:00
commit 4739cd8fea
No known key found for this signature in database
GPG Key ID: FEF6C8051D0E013C

View File

@ -15,7 +15,7 @@ import datetime
import stat
template = """
template = """\
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
fn main() {
@ -35,7 +35,7 @@ for kw in sys.argv[1:]:
os.chmod(test_file, stat.S_IWUSR)
with open(test_file, 'wt') as f:
f.write(template % (datetime.datetime.now().year, kw, kw, kw))
f.write(template % (kw, kw, kw))
# mark file read-only
os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)