Replace SortedDict with OrderedDict
This commit is contained in:
		| @@ -10,7 +10,12 @@ from django.core.management.base import NoArgsCommand, CommandError | |||||||
| import django.template | import django.template | ||||||
| from django.template import Context | from django.template import Context | ||||||
| from django.utils import six | from django.utils import six | ||||||
| from django.utils.datastructures import SortedDict |  | ||||||
|  | try: | ||||||
|  |     from collections import OrderedDict | ||||||
|  | except ImportError: | ||||||
|  |     from django.utils.datastructures import SortedDict as OrderedDict | ||||||
|  |  | ||||||
| try: | try: | ||||||
|     from importlib import import_module |     from importlib import import_module | ||||||
| except: | except: | ||||||
| @@ -170,7 +175,7 @@ class Command(NoArgsCommand): | |||||||
|         engine = options.get("engine", "django") |         engine = options.get("engine", "django") | ||||||
|         parser = self.__get_parser(engine) |         parser = self.__get_parser(engine) | ||||||
|  |  | ||||||
|         compressor_nodes = SortedDict() |         compressor_nodes = OrderedDict() | ||||||
|         for template_name in templates: |         for template_name in templates: | ||||||
|             try: |             try: | ||||||
|                 template = parser.parse(template_name) |                 template = parser.parse(template_name) | ||||||
| @@ -226,7 +231,7 @@ class Command(NoArgsCommand): | |||||||
|         log.write("Compressing... ") |         log.write("Compressing... ") | ||||||
|         block_count = context_count = 0 |         block_count = context_count = 0 | ||||||
|         results = [] |         results = [] | ||||||
|         offline_manifest = SortedDict() |         offline_manifest = OrderedDict() | ||||||
|  |  | ||||||
|         for context_dict in contexts: |         for context_dict in contexts: | ||||||
|             context_count += 1 |             context_count += 1 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carlton Gibson
					Carlton Gibson