diff --git a/lms/djangoapps/debug/management/commands/dump_xml_courses.py b/lms/djangoapps/debug/management/commands/dump_xml_courses.py index 86786e5017..78d44642f3 100644 --- a/lms/djangoapps/debug/management/commands/dump_xml_courses.py +++ b/lms/djangoapps/debug/management/commands/dump_xml_courses.py @@ -7,10 +7,11 @@ each as a separate output file containing the json representation of each of its fields (including those fields that are set as default values). """ -from __future__ import print_function +from __future__ import absolute_import, print_function import json +import six from django.conf import settings from django.core.management.base import BaseCommand, CommandError from path import Path as path @@ -40,12 +41,12 @@ class Command(BaseCommand): export_dir = path(args[0]) - for course_id, course_modules in xml_module_store.modules.iteritems(): + for course_id, course_modules in six.iteritems(xml_module_store.modules): course_path = course_id.replace('/', '_') - for location, descriptor in course_modules.iteritems(): + for location, descriptor in six.iteritems(course_modules): location_path = text_type(location).replace('/', '_') data = {} - for field_name, field in descriptor.fields.iteritems(): + for field_name, field in six.iteritems(descriptor.fields): try: data[field_name] = field.read_json(descriptor) except Exception as exc: # pylint: disable=broad-except diff --git a/lms/djangoapps/debug/views.py b/lms/djangoapps/debug/views.py index beddabee71..4cc4c37579 100644 --- a/lms/djangoapps/debug/views.py +++ b/lms/djangoapps/debug/views.py @@ -1,5 +1,7 @@ """Views for debugging and diagnostics""" +from __future__ import absolute_import + import pprint import traceback