Commit 37befe5c by Victor Shnayder

make clean_xml script work with stringified errors

parent 217fdc4d
...@@ -61,11 +61,7 @@ def import_with_checks(course_dir, verbose=True): ...@@ -61,11 +61,7 @@ def import_with_checks(course_dir, verbose=True):
course_dirs=course_dirs) course_dirs=course_dirs)
def str_of_err(tpl): def str_of_err(tpl):
(msg, exc_info) = tpl (msg, exc_str) = tpl
if exc_info is None:
return msg
exc_str = '\n'.join(traceback.format_exception(*exc_info))
return '{msg}\n{exc}'.format(msg=msg, exc=exc_str) return '{msg}\n{exc}'.format(msg=msg, exc=exc_str)
courses = modulestore.get_courses() courses = modulestore.get_courses()
...@@ -83,7 +79,7 @@ def import_with_checks(course_dir, verbose=True): ...@@ -83,7 +79,7 @@ def import_with_checks(course_dir, verbose=True):
print '\n' print '\n'
print "=" * 40 print "=" * 40
print 'ERRORs during import:' print 'ERRORs during import:'
print '\n'.join(map(str_of_err,errors)) print '\n'.join(map(str_of_err, errors))
print "=" * 40 print "=" * 40
print '\n' print '\n'
......
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