Philipp Hörist pushed to branch master at gajim / gajim
Commits: 3d8be9eb by Philipp Hörist at 2017-07-03T11:32:47+02:00 Fix emoticons module import on windows - - - - - 1 changed file: - gajim/emoticons.py Changes: ===================================== gajim/emoticons.py ===================================== --- a/gajim/emoticons.py +++ b/gajim/emoticons.py @@ -16,6 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os +import sys import logging import importlib.util as imp from collections import OrderedDict @@ -58,8 +59,13 @@ class SubPixbuf: return subpixbuf def load(path): - theme_path = os.path.join(path, 'emoticons_theme.py') - spec = imp.spec_from_file_location("emoticons_theme.py", theme_path) + module_name = 'emoticons_theme.py' + theme_path = os.path.join(path, module_name) + if sys.platform == 'win32' and not os.path.exists(theme_path): + module_name = 'emoticons_theme.pyc' + theme_path = os.path.join(path, module_name) + + spec = imp.spec_from_file_location(module_name, theme_path) try: theme = imp.module_from_spec(spec) spec.loader.exec_module(theme) View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3d8be9ebe2055ea1ef4d66504cf5cca377942b63
_______________________________________________ Commits mailing list [email protected] https://lists.gajim.org/cgi-bin/listinfo/commits
