A person makes a Type I error when they rejected a null hypothesis that could possibly be true. In this case, the politician is saying that he will certainly win the election. Of course, he is saying this before the election occurs. Since he is saying it before the election occurs, there is a chance (we do not know if it is a large or a small chance) that he will lose the election. His statement that he will win rejects that possibility.
Therefore, the politician must be testing the null hypothesis that he will lose the election. He is rejecting that null hypothesis even though it is a possible outcome. Therefore, he is committing a Type I error.