Remove trailing semicolons from Python code