From 736001e7f1f59e81f56115dad0a2b1c29797ceab Mon Sep 17 00:00:00 2001 From: aarif Date: Mon, 23 Sep 2019 16:13:41 +0500 Subject: [PATCH] python 3 fixes quality fixes python 3 fixes --- common/lib/capa/capa/capa_problem.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index 5471bc4ea2..da2bb245ff 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -22,6 +22,7 @@ from collections import OrderedDict from copy import deepcopy from datetime import datetime from xml.sax.saxutils import unescape +from openedx.core.lib.edx_six import get_gettext import six from lxml import etree @@ -643,7 +644,7 @@ class LoncapaProblem(object): choice-level explanations shown to a student after submission. Does nothing if there is no targeted-feedback attribute. """ - _ = self.capa_system.i18n.ugettext + _ = get_gettext(self.capa_system.i18n) # Note that the modifications has been done, avoiding problems if called twice. if hasattr(self, 'has_targeted'): return @@ -759,7 +760,7 @@ class LoncapaProblem(object): """ includes = self.tree.findall('.//include') for inc in includes: - filename = inc.get('file').decode('utf-8') + filename = inc.get('file') if six.PY3 else inc.get('file').decode('utf-8') if filename is not None: try: # open using LoncapaSystem OSFS filestore