Skip to content

Commit

Permalink
Merge pull request #220 from TeamHG-Memex/deprecation-warning-fix
Browse files Browse the repository at this point in the history
PY3 fixed deprecation warning
  • Loading branch information
kmike committed Jun 21, 2017
2 parents 6ac969f + 1a04cff commit b2a6240
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions eli5/formatters/html.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import cgi
from itertools import groupby, chain
from itertools import groupby
from typing import List

import numpy as np # type: ignore
Expand Down Expand Up @@ -304,4 +303,8 @@ def _format_decision_tree(treedict):


def html_escape(text):
return cgi.escape(text, quote=True)
try:
from html import escape
except ImportError:
from cgi import escape # type: ignore
return escape(text, quote=True)

0 comments on commit b2a6240

Please sign in to comment.