Skip to content

Commit 7ab271c

Browse files
committed
[lldb][examples] Use Python3 versions of types module in performance.py
2.x had ListType and StringTypes (https://docs.python.org/2.7/library/types.html), 3.x removed these (https://docs.python.org/3.0/library/types.html). We can use "str" and "list" directly as in 3.x all strings are just "str", and ListType was always an alias to "list".
1 parent f7e9968 commit 7ab271c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lldb/examples/python/performance.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import sys
1717
import subprocess
1818
import time
19-
import types
2019

2120
# ----------------------------------------------------------------------
2221
# Code that auto imports LLDB
@@ -121,19 +120,19 @@ def __init__(
121120
self.breakpoints.append(breakpoint)
122121
else:
123122
if module:
124-
if isinstance(module, types.ListType):
123+
if isinstance(module, list):
125124
for module_path in module:
126125
self.modules.Append(lldb.SBFileSpec(module_path, False))
127-
elif isinstance(module, types.StringTypes):
126+
elif isinstance(module, str):
128127
self.modules.Append(lldb.SBFileSpec(module, False))
129128
if name:
130129
# "file" can be a list or a string
131130
if file:
132-
if isinstance(file, types.ListType):
131+
if isinstance(file, list):
133132
self.files = lldb.SBFileSpecList()
134133
for f in file:
135134
self.files.Append(lldb.SBFileSpec(f, False))
136-
elif isinstance(file, types.StringTypes):
135+
elif isinstance(file, str):
137136
self.files.Append(lldb.SBFileSpec(file, False))
138137
self.breakpoints.append(
139138
self.target.BreakpointCreateByName(name, self.modules, self.files)

0 commit comments

Comments
 (0)