Fix search of parent directory in python script