aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/__init__.py1
-rw-r--r--markdown/odict.py11
-rwxr-xr-xrun-tests.py2
-rw-r--r--tests/test_apis.py1
4 files changed, 4 insertions, 11 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py
index 1dbaddd..3fd5efa 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -33,7 +33,6 @@ License: BSD (see LICENSE for details).
from __future__ import absolute_import
from __future__ import unicode_literals
from .__version__ import version, version_info
-import re
import codecs
import sys
import logging
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()
diff --git a/run-tests.py b/run-tests.py
index 7756e4d..4f13eb5 100755
--- a/run-tests.py
+++ b/run-tests.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import tests
-import os, sys, getopt
+import os, sys
if len(sys.argv) > 1 and sys.argv[1] == "update":
if len(sys.argv) > 2:
diff --git a/tests/test_apis.py b/tests/test_apis.py
index e0f7a03..dd232b3 100644
--- a/tests/test_apis.py
+++ b/tests/test_apis.py
@@ -9,7 +9,6 @@ Tests of the various APIs with the python markdown lib.
from __future__ import unicode_literals
import unittest
-import os
import sys
import types
import markdown