]> git.phdru.name Git - bookmarks_db.git/blobdiff - compat.py
Fix(Py3): Fix `unicode` compatibility
[bookmarks_db.git] / compat.py
diff --git a/compat.py b/compat.py
new file mode 100644 (file)
index 0000000..ab6254c
--- /dev/null
+++ b/compat.py
@@ -0,0 +1,11 @@
+import sys
+
+# Compatability definitions (inspired by six)
+PY2 = sys.version_info[0] < 3
+if PY2:
+    # disable flake8 checks on python 3
+    string_type = basestring  # noqa
+    unicode = unicode  # noqa
+else:
+    string_type = str
+    unicode = str