From 46a936418168504db10a5827aad6448c6893ccf9 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 7 Aug 2019 00:01:26 +0200 Subject: "Fixing" TraceableText crashing on paste --- jfr_playoff/gui/frames/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'jfr_playoff') diff --git a/jfr_playoff/gui/frames/__init__.py b/jfr_playoff/gui/frames/__init__.py index 3abdff5..a02791d 100644 --- a/jfr_playoff/gui/frames/__init__.py +++ b/jfr_playoff/gui/frames/__init__.py @@ -449,7 +449,11 @@ class TraceableText(tk.Text): def _proxy(self, command, *args): cmd = (self._orig, command) + args - result = self.tk.call(cmd) + # https://stackoverflow.com/a/53418346 <- it's his fault. + try: + result = self.tk.call(cmd) + except: + return None if command in ('insert', 'delete', 'replace') and \ not self._variableLock: text = self.get('1.0', tk.END).strip() -- cgit v1.2.3