From 65058e39365bb3cdf6206c2ace40d1f9af5d2098 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 27 Feb 2013 04:25:29 -0500 Subject: Dict.keys() does not return a list in Python 3. --- markdown/__init__.py | 2 +- markdown/extensions/footnotes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown/__init__.py b/markdown/__init__.py index 068e966..8872023 100644 --- a/markdown/__init__.py +++ b/markdown/__init__.py @@ -241,7 +241,7 @@ class Markdown(object): try: self.serializer = self.output_formats[self.output_format] except KeyError as e: - valid_formats = self.output_formats.keys() + valid_formats = list(self.output_formats.keys()) valid_formats.sort() message = 'Invalid Output Format: "%s". Use one of %s.' \ % (self.output_format, diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py index b7ebc35..131466c 100644 --- a/markdown/extensions/footnotes.py +++ b/markdown/extensions/footnotes.py @@ -130,7 +130,7 @@ class FootnoteExtension(Extension): def makeFootnotesDiv(self, root): """ Return div of footnotes as et Element. """ - if not self.footnotes.keys(): + if not list(self.footnotes.keys()): return None div = etree.Element("div") -- cgit v1.2.3