def check_site_dir(self):
instdir = normalize_path(self.install_dir)<EOL>pth_file = os.path.join(instdir, '<STR_LIT>')<EOL>is_site_dir = instdir in self.all_site_dirs<EOL>if not is_site_dir and not self.multi_version:<EOL><INDENT>is_site_dir = self.check_pth_processing()<EOL><DEDENT>else:<EOL><INDENT>testfile = self.pseudo_tempname() + '<STR_LIT>'<EOL>test_exists = os.path.exists(testfile)<EOL>try:<EOL><INDENT>if test_exists:<EOL><INDENT>os.unlink(testfile)<EOL><DEDENT>open(testfile, '<STR_LIT:w>').close()<EOL>os.unlink(testfile)<EOL><DEDENT>except (OSError, IOError):<EOL><INDENT>self.cant_write_to_target()<EOL><DEDENT><DEDENT>if not is_site_dir and not self.multi_version:<EOL><INDENT>raise DistutilsError(self.no_default_version_msg())<EOL><DEDENT>if is_site_dir:<EOL><INDENT>if self.pth_file is None:<EOL><INDENT>self.pth_file = PthDistributions(pth_file, self.all_site_dirs)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.pth_file = None<EOL><DEDENT>PYTHONPATH = os.environ.get('<STR_LIT>', '<STR_LIT>').split(os.pathsep)<EOL>if instdir not in map(normalize_path, [_f for _f in PYTHONPATH if _f]):<EOL><INDENT>self.sitepy_installed = True<EOL><DEDENT>elif self.multi_version and not os.path.exists(pth_file):<EOL><INDENT>self.sitepy_installed = True  <EOL>self.pth_file = None  <EOL><DEDENT>self.install_dir = instdir<EOL>
Verify that self.install_dir is .pth-capable dir, if needed