Commit 2f29eafc authored by hjk's avatar hjk Committed by Daniel Molkentin

debugger: always use tempfile module

Change-Id: Icd9c3be33ecd69c5ada48108e783f7b5b2967557
Reviewed-on: http://codereview.qt.nokia.com/272Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Molkentin <daniel.molkentin@nokia.com>
parent c09c8702
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment