File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def activate(
7171 dict: Translations.
7272
7373 Raises:
74- Exception : If humanize cannot find the locale folder.
74+ FileNotFoundError : If humanize cannot find the locale folder.
7575 """
7676 if locale is None or locale .startswith ("en" ):
7777 _CURRENT .locale = None
@@ -85,7 +85,7 @@ def activate(
8585 "Humanize cannot determinate the default location of the 'locale' folder. "
8686 "You need to pass the path explicitly."
8787 )
88- raise Exception (msg )
88+ raise FileNotFoundError (msg )
8989 if locale not in _TRANSLATIONS :
9090 translation = gettext_module .translation ("humanize" , path , [locale ])
9191 _TRANSLATIONS [locale ] = translation
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ def test_default_locale_path_null__spec__(
234234 i18n = importlib .import_module ("humanize.i18n" )
235235 monkeypatch .setattr (i18n , "__spec__" , None )
236236
237- with pytest .raises (Exception , match = self .expected_msg ):
237+ with pytest .raises (FileNotFoundError , match = self .expected_msg ):
238238 i18n .activate ("ru_RU" )
239239
240240 def test_default_locale_path_undefined__spec__ (
@@ -243,7 +243,7 @@ def test_default_locale_path_undefined__spec__(
243243 i18n = importlib .import_module ("humanize.i18n" )
244244 monkeypatch .delattr (i18n , "__spec__" )
245245
246- with pytest .raises (Exception , match = self .expected_msg ):
246+ with pytest .raises (FileNotFoundError , match = self .expected_msg ):
247247 i18n .activate ("ru_RU" )
248248
249249 @freeze_time ("2020-02-02" )
You can’t perform that action at this time.
0 commit comments