We already had law against harassment. They are just very hard to enforce.
This law is mainly a PR move. It is a very common thing in France to pass law that will almost never be used because they are impossible to enforce. They only purpose is for the gov to say "look, we did something !".