File: _util.py

package info (click to toggle)
python-redisearch-py 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,356 kB
  • sloc: python: 1,689; makefile: 4
file content (9 lines) | stat: -rw-r--r-- 218 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
import six

def to_string(s):
    if isinstance(s, six.string_types):
        return s
    elif isinstance(s, six.binary_type):
        return s.decode('utf-8')
    else:
        return s  # Not a string we care about