Commit fb1e7f3d by David Ormsbee

Make type check for self.code a little more robust, give default val for mmlans…

Make type check for self.code a little more robust, give default val for mmlans so it's never undefined
parent f94df6e3
...@@ -999,7 +999,7 @@ def sympy_check2(): ...@@ -999,7 +999,7 @@ def sympy_check2():
self.context['debug'] = self.system.DEBUG self.context['debug'] = self.system.DEBUG
# exec the check function # exec the check function
if type(self.code) == str: if isinstance(self.code, basestring):
try: try:
exec self.code in self.context['global_context'], self.context exec self.code in self.context['global_context'], self.context
correct = self.context['correct'] correct = self.context['correct']
......
...@@ -238,8 +238,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None ...@@ -238,8 +238,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
###### PMathML input ###### ###### PMathML input ######
# convert mathml answer to formula # convert mathml answer to formula
try: try:
if dynamath: mmlans = dynamath[0] if dynamath else None
mmlans = dynamath[0]
except Exception, err: except Exception, err:
mmlans = None mmlans = None
if not mmlans: if not mmlans:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment