def fix_lib64(lib_dir, symlink=True):
if [p for p in distutils.sysconfig.get_config_vars().values()<EOL>if isinstance(p, basestring) and '<STR_LIT>' in p]:<EOL><INDENT>if is_pypy:<EOL><INDENT>logger.debug('<STR_LIT>')<EOL>return<EOL><DEDENT>logger.debug('<STR_LIT>')<EOL>assert os.path.basename(lib_dir) == '<STR_LIT>' % sys.version[:<NUM_LIT:3>], (<EOL>"<STR_LIT>" % lib_dir)<EOL>lib_parent = os.path.dirname(lib_dir)<EOL>top_level = os.path.dirname(lib_parent)<EOL>lib_dir = os.path.join(top_level, '<STR_LIT>')<EOL>lib64_link = os.path.join(top_level, '<STR_LIT>')<EOL>assert os.path.basename(lib_parent) == '<STR_LIT>', (<EOL>"<STR_LIT>" % lib_parent)<EOL>if os.path.lexists(lib64_link):<EOL><INDENT>return<EOL><DEDENT>cp_or_ln = (os.symlink if symlink else copyfile)<EOL>cp_or_ln('<STR_LIT>', lib64_link)<EOL><DEDENT>
Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y
instead of lib/pythonX.Y.  If this is such a platform we'll just create a
symlink so lib64 points to lib