def _to_bytes()

in sparkey/__init__.py [0:0]


    def _to_bytes(s, name):
        t = type(s)
        if t == bytes:
            return s
        if t != str:
            raise SparkeyException(name + " must be a string")
        return s.encode('utf-8')