def makelink(self, tarinfo, targetpath):
try:<EOL><INDENT>if tarinfo.issym():<EOL><INDENT>os.symlink(tarinfo.linkname, targetpath)<EOL><DEDENT>else:<EOL><INDENT>if os.path.exists(tarinfo._link_target):<EOL><INDENT>os.link(tarinfo._link_target, targetpath)<EOL><DEDENT>else:<EOL><INDENT>self._extract_member(self._find_link_target(tarinfo),<EOL>targetpath)<EOL><DEDENT><DEDENT><DEDENT>except symlink_exception:<EOL><INDENT>if tarinfo.issym():<EOL><INDENT>linkpath = os.path.join(os.path.dirname(tarinfo.name),<EOL>tarinfo.linkname)<EOL><DEDENT>else:<EOL><INDENT>linkpath = tarinfo.linkname<EOL><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>self._extract_member(self._find_link_target(tarinfo),<EOL>targetpath)<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ExtractError("<STR_LIT>")<EOL><DEDENT><DEDENT>
Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.