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:
commit
4739cd8fea
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ import datetime
|
||||||
import stat
|
import stat
|
||||||
|
|
||||||
|
|
||||||
template = """
|
template = """\
|
||||||
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
|
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -35,7 +35,7 @@ for kw in sys.argv[1:]:
|
||||||
os.chmod(test_file, stat.S_IWUSR)
|
os.chmod(test_file, stat.S_IWUSR)
|
||||||
|
|
||||||
with open(test_file, 'wt') as f:
|
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
|
# mark file read-only
|
||||||
os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
|
os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue