Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e49fb3e

Browse files
committedDec 17, 2016
Making more future-proof (suggestion by @Kwpolska).
1 parent 8b193c7 commit e49fb3e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎nikola/utils.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1944,12 +1944,11 @@ def load_data(path):
19441944
return loader.load(inf)
19451945

19461946

1947-
# http://stackoverflow.com/a/2087433
1948-
if sys.version_info[0] == 3 and sys.version_info[1] >= 4:
1947+
# see http://stackoverflow.com/a/2087433
1948+
try:
19491949
import html # Python 3.4 and newer
1950-
19511950
html_unescape = html.unescape
1952-
else:
1951+
except (AttributeError, ImportError):
19531952
try:
19541953
from HTMLParser import HTMLParser # Python 2.6 and 2.7
19551954
except ImportError:

0 commit comments

Comments
 (0)
Please sign in to comment.