about summary refs log tree commit diff
path: root/kcc-c2e.py
diff options
context:
space:
mode:
Diffstat (limited to 'kcc-c2e.py')
-rw-r--r--kcc-c2e.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/kcc-c2e.py b/kcc-c2e.py
index 76dcf81..54b2e03 100644
--- a/kcc-c2e.py
+++ b/kcc-c2e.py
@@ -43,12 +43,16 @@ try:
 except ImportError:
     missing.append('Pillow 2.3.0+')
 if len(missing) > 0:
-    print('ERROR: ' + ', '.join(missing) + ' is not installed!')
-    import tkinter
-    import tkinter.messagebox
-    importRoot = tkinter.Tk()
-    importRoot.withdraw()
-    tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!')
+    try:
+        # noinspection PyUnresolvedReferences
+        import tkinter
+        # noinspection PyUnresolvedReferences
+        import tkinter.messagebox
+        importRoot = tkinter.Tk()
+        importRoot.withdraw()
+        tkinter.messagebox.showerror('KCC - Error', 'ERROR: ' + ', '.join(missing) + ' is not installed!')
+    except ImportError:
+        print('ERROR: ' + ', '.join(missing) + ' is not installed!')
     exit(1)
 
 import sys