def asbytes(s):
    """Turns unicode into bytes, if needed.

    Assumes UTF-8.
    """
    if isinstance(s, bytes):
        return s
    else:
        return s.encode('utf-8')
Turns unicode into bytes, if needed.

    Assumes UTF-8.
    
bin/scp.py