Index: third_party/markupsafe/_native.py |
diff --git a/third_party/jinja2/_markupsafe/_native.py b/third_party/markupsafe/_native.py |
similarity index 86% |
copy from third_party/jinja2/_markupsafe/_native.py |
copy to third_party/markupsafe/_native.py |
index 7b95828ec87f7e7e2c8af4e5ce343eedbe3fa038..5e83f10a117c4717975327337ef43d0a14a91e96 100644 |
--- a/third_party/jinja2/_markupsafe/_native.py |
+++ b/third_party/markupsafe/_native.py |
@@ -8,7 +8,8 @@ |
:copyright: (c) 2010 by Armin Ronacher. |
:license: BSD, see LICENSE for more details. |
""" |
-from jinja2._markupsafe import Markup |
+from markupsafe import Markup |
+from markupsafe._compat import text_type |
def escape(s): |
@@ -18,7 +19,7 @@ def escape(s): |
""" |
if hasattr(s, '__html__'): |
return s.__html__() |
- return Markup(unicode(s) |
+ return Markup(text_type(s) |
.replace('&', '&') |
.replace('>', '>') |
.replace('<', '<') |
@@ -40,6 +41,6 @@ def soft_unicode(s): |
"""Make a string unicode if it isn't already. That way a markup |
string is not converted back to unicode. |
""" |
- if not isinstance(s, unicode): |
- s = unicode(s) |
+ if not isinstance(s, text_type): |
+ s = text_type(s) |
return s |