Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add compat module

  • Loading branch information...
commit 58e46c21ad674be2b6d65529caebf529dcf010dc 1 parent 60d7633
@mcdonc mcdonc authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 translationstring/compat.py
View
18 translationstring/compat.py
@@ -0,0 +1,18 @@
+import sys
+
+PY3 = sys.version_info[0] == 3
+
+if PY3: # pragma: no cover
+ string_types = (str,)
+ text_type = str
+else: # pragma: no cover
+ string_types = (basestring,)
+ text_type = unicode
+
+if PY3: # pragma: no cover
+ def u(s):
+ return s
+else: # pragma: no cover
+ def u(s):
+ return unicode(s, 'unicode_escape')
+
Please sign in to comment.
Something went wrong with that request. Please try again.