Fixed python version problem regarding return value of wait