Add compat file for Py26 OrderedDict.

This commit is contained in:
Steve Pulec 2014-11-29 22:43:30 -05:00
parent a48995f875
commit c5487a4464
5 changed files with 9 additions and 21 deletions

5
moto/compat.py Normal file
View File

@ -0,0 +1,5 @@
try:
from collections import OrderedDict # flake8: noqa
except ImportError:
# python 2.6 or earlier, use backport
from ordereddict import OrderedDict # flake8: noqa

View File

@ -3,13 +3,7 @@ from collections import defaultdict
import datetime
import json
try:
from collections import OrderedDict
except ImportError:
# python 2.6 or earlier, use backport
from ordereddict import OrderedDict
from moto.compat import OrderedDict
from moto.core import BaseBackend
from .comparisons import get_comparison_func
from .utils import unix_time

View File

@ -3,13 +3,7 @@ from collections import defaultdict
import datetime
import json
try:
from collections import OrderedDict
except ImportError:
# python 2.6 or earlier, use backport
from ordereddict import OrderedDict
from moto.compat import OrderedDict
from moto.core import BaseBackend
from .comparisons import get_comparison_func
from .utils import unix_time

View File

@ -1,16 +1,11 @@
from __future__ import unicode_literals
import boto.kinesis
from moto.compat import OrderedDict
from moto.core import BaseBackend
from .exceptions import StreamNotFoundError, ShardNotFoundError
from .utils import compose_shard_iterator, compose_new_shard_iterator, decompose_shard_iterator
try:
from collections import OrderedDict
except ImportError:
# python 2.6 or earlier, use backport
from ordereddict import OrderedDict
class Record(object):
def __init__(self, partition_key, data, sequence_number):

View File

@ -1,6 +1,5 @@
from __future__ import unicode_literals
from collections import OrderedDict
import datetime
import uuid
@ -8,6 +7,7 @@ import boto.sns
import requests
import six
from moto.compat import OrderedDict
from moto.core import BaseBackend
from moto.core.utils import iso_8601_datetime
from moto.sqs import sqs_backends