Merge branch 'master' of ssh://git.latice.de/var/lib/git/jiten-pai
authorUrban Wallasch <urban.wallasch@freenet.de>
Tue, 15 Jun 2021 15:50:26 +0000 (17:50 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Tue, 15 Jun 2021 15:50:26 +0000 (17:50 +0200)
1  2 
jiten-pai.py

diff --cc jiten-pai.py
index 5dc4d84817910c782e7288dac7b9399d1bd76a4c,c331833375a484e34f55e99cd8470250652598c5..a501e2a3967b8d1c96a36411bfcde2e40be76d4d
@@@ -484,9 -481,12 +491,12 @@@ class jpMainWindow(QMainWindow)
  
  def dict_lookup(dict_fname, pattern, mode, max_res=0):
      result = []
 -    cnt = 0;
 +    cnt = 0
      with open(dict_fname) as dict_file:
-         re_pattern = re.compile(pattern, re.IGNORECASE)
+         try:
+             re_pattern = re.compile(pattern, re.IGNORECASE)
+         except:
+             return result
          for line in dict_file:
              if max_res and cnt >= max_res:
                  break