Created
February 16, 2014 08:54
-
-
Save modocache/9031335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: tests/cindex/test_translation_unit.py | |
=================================================================== | |
--- tests/cindex/test_translation_unit.py (revision 201083) | |
+++ tests/cindex/test_translation_unit.py (working copy) | |
@@ -1,5 +1,6 @@ | |
import gc | |
import os | |
+import tempfile | |
from clang.cindex import CursorKind | |
from clang.cindex import Cursor | |
@@ -93,15 +94,7 @@ | |
Returns the filename it was saved to. | |
""" | |
- | |
- # 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) | |
- | |
+ _, path = tempfile.mkstemp() | |
tu.save(path) | |
return path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment