Преглед на файлове

Precises exception catch

Adrien Panay преди 8 години
родител
ревизия
5c7e89c039
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      tracim/tracim/lib/helpers.py

+ 3 - 3
tracim/tracim/lib/helpers.py Целия файл

38
     """
38
     """
39
     # TODO - A.P - language code access from test environment
39
     # TODO - A.P - language code access from test environment
40
     # try based workaround instead of raw get language call for test
40
     # try based workaround instead of raw get language call for test
41
-    # environment only, this should be set with tg.i18n.set_lang in
42
-    # be I was unable to achieve that.
41
+    # environment only, this should be set with tg.i18n.set_lang but
42
+    # I was unable to achieve that.
43
     try:
43
     try:
44
         result = tg.i18n.get_lang(all=False)[0]
44
         result = tg.i18n.get_lang(all=False)[0]
45
-    except:
45
+    except IndexError:
46
         result = 'en'
46
         result = 'en'
47
     return result
47
     return result
48
 
48