Fix global name 'subprocess' is not defined bug