mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 05:25:38 +01:00
Use the base name of the generating script, not the full path
Otherwise the generation is sensitive to trivial differences such as running `tests/scripts/generate_psa_tests.py` vs `./tests/scripts/generate_psa_tests.py` vs an absolute path. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
af1728442d
commit
505cc641de
@ -17,6 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
from typing import Any, Iterable, List, Optional
|
from typing import Any, Iterable, List, Optional
|
||||||
import typing_extensions #pylint: disable=import-error
|
import typing_extensions #pylint: disable=import-error
|
||||||
@ -98,7 +99,7 @@ def write_data_file(filename: str,
|
|||||||
If the file already exists, it is overwritten.
|
If the file already exists, it is overwritten.
|
||||||
"""
|
"""
|
||||||
if caller is None:
|
if caller is None:
|
||||||
caller = sys.argv[0]
|
caller = os.path.basename(sys.argv[0])
|
||||||
with open(filename, 'w') as out:
|
with open(filename, 'w') as out:
|
||||||
out.write('# Automatically generated by {}. Do not edit!\n'
|
out.write('# Automatically generated by {}. Do not edit!\n'
|
||||||
.format(caller))
|
.format(caller))
|
||||||
|
Loading…
Reference in New Issue
Block a user