def METHOD_NAME(a, b):
    # dup2() removes the CLOEXEC flag but
    # we must do it ourselves if dup2()
    # would be a no-op (issue #10806).
    if a == b:
        _set_cloexec(a, False)
    elif a != -1:
        os.dup2(a, b)