From 20429a84aadead9880b7d298b666c66970cda72d Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Fri, 5 Mar 2010 15:24:39 +0100
Subject: [PATCH] Use __builtin__.dir instead of dir in Python

Somehow, some gdb define a string with the name 'gdb' and we can't
find where. But be on the safe side and use the builtin function
always.

Reviewed-By: hjk
---
 share/qtcreator/gdbmacros/dumper.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py
index 96c50cee30f..0cbbacd6d5c 100644
--- a/share/qtcreator/gdbmacros/dumper.py
+++ b/share/qtcreator/gdbmacros/dumper.py
@@ -8,6 +8,7 @@ import traceback
 import gdb
 import base64
 import os
+import __builtin__
 
 if os.name != "nt":
     import curses.ascii
@@ -32,7 +33,7 @@ def qmin(n, m):
 def isGoodGdb():
     #return gdb.VERSION.startswith("6.8.50.2009") \
     #   and gdb.VERSION != "6.8.50.20090630-cvs"
-    return 'parse_and_eval' in dir(gdb)
+    return 'parse_and_eval' in __builtin__.dir(gdb)
 
 def cleanAddress(addr):
     if addr is None:
@@ -202,7 +203,7 @@ def listOfLocals(varList):
         return []
 
     # gdb-6.8-symbianelf fails here
-    hasBlock = 'block' in dir(frame)
+    hasBlock = 'block' in __builtin__.dir(frame)
 
     items = []
     if hasBlock and isGoodGdb():
-- 
GitLab