aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2013-03-23 15:18:51 +0400
committerDmitry Shachnev <mitya57@gmail.com>2013-03-23 15:18:51 +0400
commitc10dfac9909282b54a48be6261f76ba11d9da6d0 (patch)
treed2b4e8c5c0042213bd916c66ab7f06f1b642e84f
parent299bb08bfe203dff0843b9ec9b9c565a63be1c4c (diff)
downloadmarkdown-c10dfac9909282b54a48be6261f76ba11d9da6d0.tar.gz
markdown-c10dfac9909282b54a48be6261f76ba11d9da6d0.tar.bz2
markdown-c10dfac9909282b54a48be6261f76ba11d9da6d0.zip
odict.py: remove usage of iteritems_compat which was not working
I've added iteritems_compat function in one of my previous pull requests, which was failing with: ./markdown/odict.py:106: undefined name 'iteritems_compat' This commit drops usage of that function.
-rw-r--r--markdown/odict.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/markdown/odict.py b/markdown/odict.py
index 8089ece..68c1259 100644
--- a/markdown/odict.py
+++ b/markdown/odict.py
@@ -4,11 +4,6 @@ from . import util
from copy import deepcopy
-def iteritems_compat(d):
- """Return an iterator over the (key, value) pairs of a dictionary.
- Copied from `six` module."""
- return iter(getattr(d, _iteritems)())
-
class OrderedDict(dict):
"""
A dictionary that keeps its keys in the order in which they're inserted.
@@ -106,8 +101,8 @@ class OrderedDict(dict):
return [self[k] for k in self.keyOrder]
def update(self, dict_):
- for k, v in iteritems_compat(dict_):
- self[k] = v
+ for k in dict_:
+ self[k] = dict_[k]
def setdefault(self, key, default):
if key not in self:
@@ -138,7 +133,7 @@ class OrderedDict(dict):
Replaces the normal dict.__repr__ with a version that returns the keys
in their Ordered order.
"""
- return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in iteritems_compat(self)])
+ return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in self._iteritems()])
def clear(self):
super(OrderedDict, self).clear()