aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/examples')
-rw-r--r--lldb/examples/python/lldbtk.py8
-rwxr-xr-xlldb/examples/python/performance.py9
-rw-r--r--lldb/examples/summaries/cocoa/CFString.py7
3 files changed, 7 insertions, 17 deletions
diff --git a/lldb/examples/python/lldbtk.py b/lldb/examples/python/lldbtk.py
index f1685c0..72fe91e 100644
--- a/lldb/examples/python/lldbtk.py
+++ b/lldb/examples/python/lldbtk.py
@@ -4,12 +4,8 @@ import lldb
import shlex
import sys
-try:
- from tkinter import *
- import tkinter.ttk as ttk
-except ImportError:
- from Tkinter import *
- import ttk
+from tkinter import *
+import tkinter.ttk as ttk
class ValueTreeItemDelegate(object):
diff --git a/lldb/examples/python/performance.py b/lldb/examples/python/performance.py
index b86b5a5..c3181b6 100755
--- a/lldb/examples/python/performance.py
+++ b/lldb/examples/python/performance.py
@@ -16,7 +16,6 @@ import resource
import sys
import subprocess
import time
-import types
# ----------------------------------------------------------------------
# Code that auto imports LLDB
@@ -121,19 +120,19 @@ class BreakpointAction(Action):
self.breakpoints.append(breakpoint)
else:
if module:
- if isinstance(module, types.ListType):
+ if isinstance(module, list):
for module_path in module:
self.modules.Append(lldb.SBFileSpec(module_path, False))
- elif isinstance(module, types.StringTypes):
+ elif isinstance(module, str):
self.modules.Append(lldb.SBFileSpec(module, False))
if name:
# "file" can be a list or a string
if file:
- if isinstance(file, types.ListType):
+ if isinstance(file, list):
self.files = lldb.SBFileSpecList()
for f in file:
self.files.Append(lldb.SBFileSpec(f, False))
- elif isinstance(file, types.StringTypes):
+ elif isinstance(file, str):
self.files.Append(lldb.SBFileSpec(file, False))
self.breakpoints.append(
self.target.BreakpointCreateByName(name, self.modules, self.files)
diff --git a/lldb/examples/summaries/cocoa/CFString.py b/lldb/examples/summaries/cocoa/CFString.py
index 74bd927..02b6706 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -11,11 +11,6 @@ import lldb
import lldb.runtime.objc.objc_runtime
import lldb.formatters.Logger
-try:
- unichr
-except NameError:
- unichr = chr
-
def CFString_SummaryProvider(valobj, dict):
logger = lldb.formatters.Logger.Logger()
@@ -107,7 +102,7 @@ class CFStringSynthProvider:
value = b1 * 256 + b0
else:
value = b0 * 256 + b1
- pystr = pystr + unichr(value)
+ pystr = pystr + chr(value)
# read max_len unicode values, not max_len bytes
max_len = max_len - 1
return pystr