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

debugger: always use tempfile module

Change-Id: Icd9c3be33ecd69c5ada48108e783f7b5b2967557
Reviewed-on: http://codereview.qt.nokia.com/272

Reviewed-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 ...@@ -5,6 +5,7 @@ import gdb
import base64 import base64
import __builtin__ import __builtin__
import os import os
import tempfile
# Fails on Windows. # Fails on Windows.
try: try:
...@@ -22,7 +23,6 @@ except: ...@@ -22,7 +23,6 @@ except:
# Fails on SimulatorQt. # Fails on SimulatorQt.
tempFileCounter = 0 tempFileCounter = 0
try: try:
import tempfile
# Test if 2.6 is used (Windows), trigger exception and default # Test if 2.6 is used (Windows), trigger exception and default
# to 2nd version. # to 2nd version.
tempfile.NamedTemporaryFile(prefix="gdbpy_",delete=True) tempfile.NamedTemporaryFile(prefix="gdbpy_",delete=True)
...@@ -35,7 +35,8 @@ except: ...@@ -35,7 +35,8 @@ except:
def createTempFile(): def createTempFile():
global tempFileCounter global tempFileCounter
tempFileCounter += 1 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 return fileName, None
def removeTempFile(name, file): 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