Dont fail when importing plugin_i18n for tests

This commit is contained in:
Philipp Hörist 2018-11-21 21:44:19 +01:00
parent 1196e1df0d
commit cb05671254
1 changed files with 7 additions and 1 deletions

View File

@ -21,7 +21,13 @@ import gettext
from gajim.common import configpaths
DOMAIN = 'gajim_plugins'
plugin_user_dir = configpaths.get('PLUGINS_USER')
try:
plugin_user_dir = configpaths.get('PLUGINS_USER')
except KeyError:
# This allows to import the module for tests
print('No plugin translation path available')
plugin_user_dir = ''
plugins_locale_dir = os.path.join(plugin_user_dir, 'locale')
try: