I have a better suggestion. I had a vented cap that failed which would cause the engine to die. It would run fine with the cap loosened. If the cap was tight the engine would die but in the process of dying, I could loosen the cap and it would run fine
I put a sewing needle in a pair of vice grips and heated the needle until it glowed. Then I melted a tiny hole in the cap with the needle. It's been fine ever since and no issues with water getting in the tank.
It's cheaper than replacing the gas cap.