Skip to content

Commit e36a3f8

Browse files
committed
Fix __main__.py for python2
1 parent a46f8f2 commit e36a3f8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tkfilebrowser/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@
2020
Example
2121
"""
2222

23-
from tkfilebrowser.constants import tk, ttk
2423
from tkfilebrowser import askopendirname, askopenfilenames, asksaveasfilename
25-
from tkinter import filedialog
24+
try:
25+
import tkinter as tk
26+
from tkinter import ttk
27+
from tkinter import filedialog
28+
except ImportError:
29+
import Tkinter as tk
30+
import ttk
31+
import tkFileDialog as filedialog
2632

2733
root = tk.Tk()
2834

0 commit comments

Comments
 (0)