def removeOpcode(pkscript, opcode):
    """Removes any occurrence of opcode from pkscript."""
    retScript = b''
    for pop in pkscript:
        if pop.opcode.value != opcode:
            retScript += pop
    return retScript
