From: Urban Wallasch Date: Tue, 15 Jun 2021 16:26:03 +0000 (+0200) Subject: * Print error messages for regex compiler exceptions. X-Git-Tag: v0.1.0~134 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=bb587f4861743d263b0f07142e03afd45986be27;p=jiten-pai.git * Print error messages for regex compiler exceptions. --- diff --git a/jiten-pai.py b/jiten-pai.py index d4eef5c..832d727 100755 --- a/jiten-pai.py +++ b/jiten-pai.py @@ -865,7 +865,8 @@ class jpMainWindow(QMainWindow): term = self.search_box.lineEdit().text() try: re_term = re.compile(kata2hira(term), re.IGNORECASE) - except: + except Exception as e: + eprint(term, str(e)) re_term = re.compile('', re.IGNORECASE) nfmt = '
' % (cfg['nfont'], cfg['nfont_sz']) lfmt = '' % (cfg['lfont'], cfg['lfont_sz']) @@ -905,7 +906,8 @@ def dict_lookup(dict_fname, pattern, mode, limit=0): with open(dict_fname) as dict_file: try: re_pattern = re.compile(pattern, re.IGNORECASE) - except: + except Exception as e: + eprint(pattern, str(e)) return result for line in dict_file: if limit and cnt >= limit: