+python3 compatibility

Running :python with exec does not work inside if so I have to move it outside of the if.