diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 78c986a963..ad084bdaf7 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -999,7 +999,7 @@ def sympy_check2(): self.context['debug'] = self.system.DEBUG # exec the check function - if type(self.code) == str: + if isinstance(self.code, basestring): try: exec self.code in self.context['global_context'], self.context correct = self.context['correct'] diff --git a/lms/lib/symmath/symmath_check.py b/lms/lib/symmath/symmath_check.py index a3dec4aae5..d386ea6b06 100644 --- a/lms/lib/symmath/symmath_check.py +++ b/lms/lib/symmath/symmath_check.py @@ -238,8 +238,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None ###### PMathML input ###### # convert mathml answer to formula try: - if dynamath: - mmlans = dynamath[0] + mmlans = dynamath[0] if dynamath else None except Exception, err: mmlans = None if not mmlans: