debugger: always use tempfile module

Change-Id: Icd9c3be33ecd69c5ada48108e783f7b5b2967557
Reviewed-on: http://codereview.qt.nokia.com/272
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
This commit is contained in:
hjk
2011-05-31 15:34:50 +02:00
committed by Daniel Molkentin
parent c09c870248
commit 2f29eafcad

View File

@@ -5,6 +5,7 @@ import gdb
import base64
import __builtin__
import os
import tempfile
# Fails on Windows.
try:
@@ -22,7 +23,6 @@ except:
# Fails on SimulatorQt.
tempFileCounter = 0
try:
import tempfile
# Test if 2.6 is used (Windows), trigger exception and default
# to 2nd version.
tempfile.NamedTemporaryFile(prefix="gdbpy_",delete=True)
@@ -35,7 +35,8 @@ except:
def createTempFile():
global tempFileCounter
tempFileCounter += 1
fileName = "%s/gdbpy_tmp_%d_%d" % (tempfile.gettempdir(), os.getpid(), tempFileCounter)
fileName = "%s/gdbpy_tmp_%d_%d" \
% (tempfile.gettempdir(), os.getpid(), tempFileCounter)
return fileName, None
def removeTempFile(name, file):