def dencrypt(command, pw, data):
    """
    Encrypts or decrypts, by running command
    """
    if pw in '\n':
        raise Exception('Newlines not allowed in passwords')
    proc = subprocess.Popen(
        command,
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )
    proc.stdin.write(force_bytes(pw))
    proc.stdin.write(b'\n')
    proc.stdin.write(data)
    output, erroroutput = proc.communicate()
    if proc.returncode != 0:
        raise gpg_exception_factory(proc.returncode, erroroutput)
    return output
dataset/ETHPy150Open gavinwahl/sdb/sdb/passwords.py/dencrypt/swapped operands of `in`