Remember that? That was the 1928 pact that outlawed war.
You might remember how well that worked out.
This will work out just swell until Russia or China or ISIS develop an effective fighting robot and are able to deploy them in sufficient quantities to make a decisive difference in battle.
Plus there's the impossibility of enforcement. How can you prove it was a robot rather than a remote-operated drone?
And there's the tiny issue that, knowing how slowly the wheels of the "international community's" court systems turn, the war is likely to be won or lost before those violating it ever come to trial...