1
0
Fork 0
forked from github/pelican

fix python3 support

This commit is contained in:
dave mankoff 2013-01-28 22:21:45 -05:00
commit 2a3d7d0319
2 changed files with 6 additions and 3 deletions

View file

@ -26,7 +26,10 @@ except ImportError:
import re import re
import cgi import cgi
from HTMLParser import HTMLParser try:
from html.parser import HTMLParser
except ImportError:
from HTMLParser import HTMLParser
from pelican.contents import Category, Tag, Author from pelican.contents import Category, Tag, Author
from pelican.utils import get_date, pelican_open from pelican.utils import get_date, pelican_open

View file

@ -286,9 +286,9 @@ class HTMLReaderTest(unittest.TestCase):
content, metadata = reader.read(_path('article_with_metadata.html')) content, metadata = reader.read(_path('article_with_metadata.html'))
expected = { expected = {
'category': 'yeah', 'category': 'yeah',
'author': u'Alexis Métaireau', 'author': 'Alexis Métaireau',
'title': 'This is a super article !', 'title': 'This is a super article !',
'summary': u'''Summary and stuff''', 'summary': 'Summary and stuff',
'date': datetime.datetime(2010, 12, 2, 10, 14), 'date': datetime.datetime(2010, 12, 2, 10, 14),
'tags': ['foo', 'bar', 'foobar'], 'tags': ['foo', 'bar', 'foobar'],
'custom_field': 'http://notmyidea.org', 'custom_field': 'http://notmyidea.org',