Make OpenCafe py2.6 compatible

This patch updates the OrderedDict import to be python 2.6
compatible. This is needed for downstream projects that use
Open Cafe and need to run with older versions of python.

Change-Id: I1d6ae1ee6d214adca8333d2f469a1366890ceaa7
This commit is contained in:
Malini Kamalambal 2014-08-18 14:02:53 -04:00
parent 179b992aba
commit 2416f8acd8
3 changed files with 7 additions and 3 deletions

View File

@ -17,7 +17,11 @@ limitations under the License.
import logging
import os
import sys
from collections import OrderedDict
try:
from collections import OrderedDict
except ImportError:
# python 2.6 or earlier, use backport
from ordereddict import OrderedDict
log = logging.getLogger('RunnerLog')

View File

@ -1 +1 @@
six
six

View File

@ -52,7 +52,7 @@ requires = open('pip-requires').readlines()
# Add additional requires for Python 2.6 support
if sys.version_info < (2, 7):
oldpy_requires = ['argparse>=1.2.1', 'unittest2>=0.5.1']
oldpy_requires = ['argparse>=1.2.1', 'unittest2>=0.5.1', 'ordereddict']
requires.extend(oldpy_requires)