Mercurial > code > home > repos > light9
changeset 1239:0025b04a1c0a
tkinter not required
Ignore-this: b8538eaa508d2a41fbbc10782708e3a6
author | drewp@bigasterisk.com |
---|---|
date | Fri, 12 Jun 2015 10:01:24 +0000 |
parents | cb300d230efd |
children | c6d675ee3de4 |
files | bin/run_local.py |
diffstat | 1 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/run_local.py Thu Jun 11 08:19:44 2015 +0000 +++ b/bin/run_local.py Fri Jun 12 10:01:24 2015 +0000 @@ -7,14 +7,18 @@ from twisted.python.failure import Failure -import Tkinter -def rce(self, exc, val, tb): - sys.stderr.write("Exception in Tkinter callback\n") - if True: - sys.excepthook(exc, val, tb) - else: - Failure(val, exc, tb).printDetailedTraceback() -Tkinter.Tk.report_callback_exception = rce +try: + import Tkinter +except ImportError: + pass +else: + def rce(self, exc, val, tb): + sys.stderr.write("Exception in Tkinter callback\n") + if True: + sys.excepthook(exc, val, tb) + else: + Failure(val, exc, tb).printDetailedTraceback() + Tkinter.Tk.report_callback_exception = rce import coloredlogs, logging, time try: