diff --git a/cms/envs/bok_choy.py b/cms/envs/bok_choy.py index 7ac1e0a859..7ed18f4fca 100644 --- a/cms/envs/bok_choy.py +++ b/cms/envs/bok_choy.py @@ -11,10 +11,15 @@ support both generating static assets to a directory and also serving static from the same directory. """ +from __future__ import absolute_import + +# Silence noisy logs +import logging import os -from path import Path as path from django.utils.translation import ugettext_lazy +from path import Path as path + from openedx.core.release import RELEASE_LINE ########################## Prod-like settings ################################### @@ -82,8 +87,6 @@ MEDIA_ROOT = TEST_ROOT / "uploads" WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = TEST_ROOT / "staticfiles" / "cms" / "webpack-stats.json" -# Silence noisy logs -import logging LOG_OVERRIDES = [ ('track.middleware', logging.CRITICAL), ('edx.discussion', logging.CRITICAL), diff --git a/cms/envs/devstack_optimized.py b/cms/envs/devstack_optimized.py index 8763669f3f..132357358b 100644 --- a/cms/envs/devstack_optimized.py +++ b/cms/envs/devstack_optimized.py @@ -18,6 +18,8 @@ as they are for non-optimized devstack. Instead, update_assets must be invoked each time that changes have been made. """ +from __future__ import absolute_import + import os ########################## Devstack settings ################################### diff --git a/cms/lib/xblock/authoring_mixin.py b/cms/lib/xblock/authoring_mixin.py index f4d03a40b8..44b6f31158 100644 --- a/cms/lib/xblock/authoring_mixin.py +++ b/cms/lib/xblock/authoring_mixin.py @@ -2,6 +2,8 @@ Mixin class that provides authoring capabilities for XBlocks. """ +from __future__ import absolute_import + import logging from django.conf import settings diff --git a/cms/lib/xblock/field_data.py b/cms/lib/xblock/field_data.py index 67c5023ee8..53015d188b 100644 --- a/cms/lib/xblock/field_data.py +++ b/cms/lib/xblock/field_data.py @@ -2,6 +2,8 @@ :class:`~xblock.field_data.FieldData` subclasses used by the CMS """ +from __future__ import absolute_import + from xblock.field_data import SplitFieldData from xblock.fields import Scope diff --git a/cms/lib/xblock/runtime.py b/cms/lib/xblock/runtime.py index 53d2c08bb8..9b7f300632 100644 --- a/cms/lib/xblock/runtime.py +++ b/cms/lib/xblock/runtime.py @@ -2,6 +2,9 @@ XBlock runtime implementations for edX Studio """ +from __future__ import absolute_import + +import six from django.urls import reverse @@ -14,7 +17,7 @@ def handler_url(block, handler_name, suffix='', query='', thirdparty=False): raise NotImplementedError("edX Studio doesn't support third-party xblock handler urls") url = reverse('component_handler', kwargs={ - 'usage_key_string': unicode(block.scope_ids.usage_id).encode('utf-8'), + 'usage_key_string': six.text_type(block.scope_ids.usage_id).encode('utf-8'), 'handler': handler_name, 'suffix': suffix, }).rstrip('/') diff --git a/cms/lib/xblock/test/test_runtime.py b/cms/lib/xblock/test/test_runtime.py index c126399e20..27aaa49228 100644 --- a/cms/lib/xblock/test/test_runtime.py +++ b/cms/lib/xblock/test/test_runtime.py @@ -1,10 +1,12 @@ """ Tests of edX Studio runtime functionality """ +from __future__ import absolute_import + from unittest import TestCase -from urlparse import urlparse from mock import Mock +from six.moves.urllib.parse import urlparse # pylint: disable=import-error from cms.lib.xblock.runtime import handler_url