Conversion to bytes

def b(s):
    """Conversion to bytes"""
    if sys.version < '3':
        if isinstance(s, unicode): #pylint: disable=undefined-variable
            return s.encode('utf-8')
    else:
        return s