This is a false statement. As stated in the catechism, the traditional teaching of the Church throughout her history has been that the legitimate authority has a right and a duty to maintain the social order with recourse to capital punishment. To this day, it is still the official teaching of the Church. Pope John Paul II is the one who, in his effort against the culture of death, has offered the end of capital punishment as a pastoral teaching but it does not have the authority to be binding upon Catholics in good conscience who believe that capital punishment is both moral and, at times, necessary for not only keeping a murderer from killing again but to address the harm he did by seeking Justice for his crime.
This is from the first edition of the catechism; it is still a valid summary of the Church’s traditional teaching on the subject since the early days of her existence:
*“Preserving the common good of society requires rendering the aggressor unable to inflict harm. For this reason the traditional teaching of the Church has acknowledged as well-founded the right and duty of legitimate public authority to punish malefactors by means of penalties commensurate with the gravity of the crime, not excluding, in cases of extreme gravity, the death penalty” *