python: Add `text_type` Python 2/3 compatible function name.
authorLumir Balhar <lbalhar@redhat.com>
Fri, 9 Feb 2018 19:49:36 +0000 (20:49 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Feb 2018 23:18:29 +0000 (00:18 +0100)
This compatible function name represents `str` in Python 3
and `unicode` in Python 2.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/compat.py

index dfdfb7dd81ee6c789a9fc3d19e38502d8d719f9f..667a1a443b1786cebf6cca6221fcbbf25764c289 100644 (file)
@@ -23,5 +23,7 @@ PY3 = sys.version_info[0] == 3
 
 if PY3:
     integer_types = int,
+    text_type = str
 else:
     integer_types = (int, long)
+    text_type = unicode