diff options
| author | David Spickett <david.spickett@linaro.org> | 2025-10-13 13:11:11 +0000 |
|---|---|---|
| committer | David Spickett <david.spickett@linaro.org> | 2025-10-13 13:13:07 +0000 |
| commit | c6e4a6329525c714dbc603c2bb38de03450a68a0 (patch) | |
| tree | d7fce1d30e50aa751f368552084cb853562c72ca /lldb/examples/python | |
| parent | 0e025418abda731629160639e2994f02f5fac1ab (diff) | |
[lldb][examples] Remove Python 2 compatibility code in lldbtk.py
The Tkinter module was renamed to tkinter in Python 3.0.
https://docs.python.org/2/library/tkinter.html
https://docs.python.org/3/library/tkinter.html
Rest of it appears to work when imported inside of LLDB:
```
$ ./bin/lldb /tmp/test.o
(lldb) target create "/tmp/test.o"
Current executable set to '/tmp/test.o' (x86_64).
(lldb) b main
Breakpoint 1: where = test.o`main + 8 at test.c:1:18, address = 0x0000000000001131
(lldb) run
Process 121572 launched: '/tmp/test.o' (x86_64)
Process 121572 stopped
* thread #1, name = 'test.o', stop reason = breakpoint 1.1
frame #0: 0x0000555555555131 test.o`main at test.c:1:18
-> 1 int main() { int a = 1; char b = '?'; return 0; }
(lldb) command script import <...>/llvm-project/lldb/examples/python/lldbtk.py
(lldb) tk-
Available completions:
tk-process -- For more information run 'help tk-process'
tk-target -- For more information run 'help tk-target'
tk-variables -- For more information run 'help tk-variables'
(lldb) tk-process
(lldb) tk-target
(lldb) tk-variables
```
Diffstat (limited to 'lldb/examples/python')
| -rw-r--r-- | lldb/examples/python/lldbtk.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lldb/examples/python/lldbtk.py b/lldb/examples/python/lldbtk.py index f1685c04313a..72fe91e4e932 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): |
