Skip to content

Commit 5fb0cdd

Browse files
committed
drop more py26 code and don't revert the fix for #30.
1 parent d1aa498 commit 5fb0cdd

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

textile/core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
from textile.objects import Block, Table
3232

3333

34-
try:
35-
from collections import OrderedDict
36-
except ImportError:
37-
from ordereddict import OrderedDict
34+
from collections import OrderedDict
3835

3936
from six.moves import urllib
4037
urlparse, urlsplit, urlunsplit, quote, unquote = (urllib.parse.urlparse,

textile/utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
urlparse = urllib.parse.urlparse
1111
HTMLParser = html_parser.HTMLParser
1212

13-
try:
14-
from collections import OrderedDict
15-
except ImportError:
16-
from ordereddict import OrderedDict
13+
from collections import OrderedDict
1714

1815
from xml.etree import ElementTree
1916

@@ -60,8 +57,8 @@ def generate_tag(tag, content, attributes=None):
6057
# adding text by assigning it to element_tag.text. That results in
6158
# non-ascii text being html-entity encoded. Not bad, but not entirely
6259
# matching php-textile either.
63-
element_tag = ElementTree.tostringlist(element, encoding=enc,
64-
method='html')
60+
element_tag = [v.decode(enc) for v in ElementTree.tostringlist(element, encoding=enc,
61+
method='html')]
6562
element_tag.insert(len(element_tag) - 1, content)
6663
element_text = ''.join(element_tag)
6764
return element_text

0 commit comments

Comments
 (0)