[Lldb-commits] [PATCH] D59586: Python 2/3 compat: tkinter

serge via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 20 00:28:55 PDT 2019


serge-sans-paille created this revision.
serge-sans-paille added a reviewer: michaelplatings.
Herald added subscribers: lldb-commits, jdoerfert.
Herald added a project: LLDB.

Repository:
  rLLDB LLDB

https://reviews.llvm.org/D59586

Files:
  lldb/examples/python/lldbtk.py


Index: lldb/examples/python/lldbtk.py
===================================================================
--- lldb/examples/python/lldbtk.py
+++ lldb/examples/python/lldbtk.py
@@ -1,10 +1,15 @@
 #!/usr/bin/python
+from __future__ import print_function
 
 import lldb
 import shlex
 import sys
-from Tkinter import *
-import ttk
+try:
+    from tkinter import *
+    import tkinter.ttk as ttk
+except ImportError:
+    from Tkinter import *
+    import ttk
 
 
 class ValueTreeItemDelegate(object):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59586.191448.patch
Type: text/x-patch
Size: 498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190320/dc4879cc/attachment.bin>


More information about the lldb-commits mailing list