Files
codeql/python/ql/test/query-tests/Security/CWE-377-InsecureTemporaryFile/SecureTemporaryFile.py
Rasmus Wriedt Larsen 77021ae119 Python: Restructure security tests to contain query name
We were mixing between things, so this is just to keep things
consistent. Even though it's not strictly needed for all queries,
it does look nice I think
2021-07-19 16:54:34 +02:00

7 lines
193 B
Python

from tempfile import NamedTemporaryFile
def write_results(results):
with NamedTemporaryFile(mode="w+", delete=False) as f:
f.write(results)
print("Results written to", f.name)