Check os.getpid() instead of sys.executable