Commits

Jason R. Coombs  committed 30138be

Adding py25compat.collections (with OrderedDict).

  • Participants
  • Parent commits 910f1c3
  • Tags 0.7

Comments (0)

Files changed (3)

 0.7
 ~~~
 
-* Added py31compat.functools, which provides `wraps` and `update_wrapper` that
+* Added `py31compat.functools`, which provides `wraps` and `update_wrapper` that
   supply the Python 3.2 __wrapped__ attribute.
+* Added `py26compat.collections`, which provides `OrderedDict` on Python 2.6
+  and earlier (via the ordereddict package).
 
 0.6
 ~~~

File py26compat/collections.py

+# supplies OrderedDict via the ordereddict package for Python 2.5+
+from __future__ import absolute_import
+
+try:
+	from collections import OrderedDict
+except ImportError:
+	from ordereddict import OrderedDict
 Copyright © 2010-2011 Jason R. Coombs
 """
 
+import sys
+
 from setuptools import find_packages
 
 name = 'jaraco.compat'
 
+py26_reqs = ['ordereddict >= 1.1'] if sys.version_info < (2,7) else []
+
 setup_params = dict(
 	name = name,
 	use_hg_version = dict(increment='0.1'),
 	entry_points = {
 	},
 	install_requires=[
-	],
+	] + py26_reqs,
 	dependency_links = [
 	],
 	setup_requires=[