We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b193c7 commit e49fb3eCopy full SHA for e49fb3e
nikola/utils.py
@@ -1944,12 +1944,11 @@ def load_data(path):
1944
return loader.load(inf)
1945
1946
1947
-# http://stackoverflow.com/a/2087433
1948
-if sys.version_info[0] == 3 and sys.version_info[1] >= 4:
+# see http://stackoverflow.com/a/2087433
+try:
1949
import html # Python 3.4 and newer
1950
-
1951
html_unescape = html.unescape
1952
-else:
+except (AttributeError, ImportError):
1953
try:
1954
from HTMLParser import HTMLParser # Python 2.6 and 2.7
1955
except ImportError:
0 commit comments