summaryrefslogtreecommitdiff
path: root/giscanner/sourcescanner.py
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2013-03-20 07:48:59 +0100
committerDieter Verfaillie <dieterv@optionexplicit.be>2013-04-09 23:19:29 +0200
commit4894c75fcc5a0b33d5862ed8ea87eccc6f7cb4eb (patch)
tree4d07762b78f48993daf4a87f83928013ad5e9e5f /giscanner/sourcescanner.py
parente40d509f8247164ff8f893f516c6a7b37ce0a30f (diff)
downloadgobject-introspection-4894c75fcc5a0b33d5862ed8ea87eccc6f7cb4eb.tar.gz
giscanner: use mkstemp() instead of mktemp()
mktemp was deprecated in Python 2.3... https://bugzilla.gnome.org/show_bug.cgi?id=697624
Diffstat (limited to 'giscanner/sourcescanner.py')
-rw-r--r--giscanner/sourcescanner.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index de137767..bd84a605 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -303,8 +303,8 @@ class SourceScanner(object):
proc.stdin.write('#include <%s>\n' % (filename, ))
proc.stdin.close()
- tmp = tempfile.mktemp()
- fp = open(tmp, 'w+')
+ tmp_fd, tmp_name = tempfile.mkstemp()
+ fp = os.fdopen(tmp_fd, 'w+b')
while True:
data = proc.stdout.read(4096)
if data is None:
@@ -321,4 +321,4 @@ class SourceScanner(object):
self._scanner.parse_file(fp.fileno())
fp.close()
- os.unlink(tmp)
+ os.unlink(tmp_name)