Fix runtime error where dict is modified during iteration.

This commit is contained in:
Feanil Patel
2019-08-19 11:12:40 -04:00
parent 7a3230a260
commit 085b6b9468
2 changed files with 2 additions and 2 deletions

View File

@@ -1153,7 +1153,7 @@ class CourseDescriptor(CourseFields, SequenceDescriptor, LicenseMixin):
# bleh, have to parse the XML here to just pull out the url_name attribute
# I don't think it's stored anywhere in the instance.
course_file = BytesIO(xml_data.encode('ascii', 'ignore'))
course_file = BytesIO(six.binary_type(xml_data))
xml_obj = etree.parse(course_file, parser=edx_xml_parser).getroot()
policy_dir = None

View File

@@ -110,7 +110,7 @@ class XmlImportFactory(Factory):
if inline_xml:
kwargs['xml_node'].set('not_a_pointer', 'true')
for key in kwargs.keys():
for key in list(kwargs.keys()):
if key not in XML_IMPORT_ARGS:
kwargs['xml_node'].set(key, kwargs.pop(key))