summaryrefslogtreecommitdiff
path: root/representer.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2016-12-27 08:46:52 +0100
committerAnthon van der Neut <anthon@mnt.org>2016-12-27 08:46:52 +0100
commit4bad970dfac6e730e169b95950d4388c5ff8e753 (patch)
treeb3217f554fe9299b120965976d8a420684bc577e /representer.py
parent0c164ee63b6b1cb186f1769dfb928048e5dd30f4 (diff)
downloadruamel.yaml-4bad970dfac6e730e169b95950d4388c5ff8e753.tar.gz
fix 83: collections.OrderedDict (safe_) dump to !!omap (reported by Frazer McLean)0.13.6
Diffstat (limited to 'representer.py')
-rw-r--r--representer.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/representer.py b/representer.py
index 2d82cf7..00ac0c4 100644
--- a/representer.py
+++ b/representer.py
@@ -365,6 +365,11 @@ SafeRepresenter.add_representer(set,
SafeRepresenter.add_representer(ordereddict,
SafeRepresenter.represent_ordereddict)
+if sys.version_info >= (2, 7):
+ import collections
+ SafeRepresenter.add_representer(collections.OrderedDict,
+ SafeRepresenter.represent_ordereddict)
+
SafeRepresenter.add_representer(datetime.date,
SafeRepresenter.represent_date)