Skip to content
Snippets Groups Projects
Commit 3a4c2a06 authored by Argyrios Kyrtzidis's avatar Argyrios Kyrtzidis
Browse files

[libclang/python] Use a Python standard library module to create a temporary file.

Patch by Brian Gesiak!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201762 91177308-0d34-0410-b5e6-96231b3b80d8
parent 6c03a38d
No related branches found
No related tags found
No related merge requests found
import gc import gc
import os import os
import tempfile
from clang.cindex import CursorKind from clang.cindex import CursorKind
from clang.cindex import Cursor from clang.cindex import Cursor
...@@ -93,15 +94,7 @@ def save_tu(tu): ...@@ -93,15 +94,7 @@ def save_tu(tu):
Returns the filename it was saved to. Returns the filename it was saved to.
""" """
_, path = tempfile.mkstemp()
# FIXME Generate a temp file path using system APIs.
base = 'TEMP_FOR_TRANSLATIONUNIT_SAVE.c'
path = os.path.join(kInputsDir, base)
# Just in case.
if os.path.exists(path):
os.unlink(path)
tu.save(path) tu.save(path)
return path return path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment