summaryrefslogtreecommitdiff
path: root/src/zope/i18n/_compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/i18n/_compat.py')
-rw-r--r--src/zope/i18n/_compat.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zope/i18n/_compat.py b/src/zope/i18n/_compat.py
new file mode 100644
index 0000000..00fb20f
--- /dev/null
+++ b/src/zope/i18n/_compat.py
@@ -0,0 +1,8 @@
+# This gives a linting error because unicode is not defined on Python 3:
+# text_type = str if bytes is not str else unicode
+try:
+ # Python 3
+ text_type = unicode
+except NameError:
+ # Python 2
+ text_type = str