1707 self._hgtmp = osenvironb[b'HGTMP'] = ( |
1707 self._hgtmp = osenvironb[b'HGTMP'] = ( |
1708 os.path.realpath(tmpdir)) |
1708 os.path.realpath(tmpdir)) |
1709 |
1709 |
1710 if self.options.with_hg: |
1710 if self.options.with_hg: |
1711 self._installdir = None |
1711 self._installdir = None |
1712 self._bindir = os.path.dirname(os.path.realpath( |
1712 whg = self.options.with_hg |
1713 self.options.with_hg)) |
1713 # If --with-hg is not specified, we have bytes already, |
|
1714 # but if it was specified in python3 we get a str, so we |
|
1715 # have to encode it back into a bytes. |
|
1716 if sys.version_info[0] == 3: |
|
1717 if not isinstance(whg, bytes): |
|
1718 whg = whg.encode('utf-8') |
|
1719 self._bindir = os.path.dirname(os.path.realpath(whg)) |
|
1720 assert isinstance(self._bindir, bytes) |
1714 self._tmpbindir = os.path.join(self._hgtmp, b'install', b'bin') |
1721 self._tmpbindir = os.path.join(self._hgtmp, b'install', b'bin') |
1715 os.makedirs(self._tmpbindir) |
1722 os.makedirs(self._tmpbindir) |
1716 |
1723 |
1717 # This looks redundant with how Python initializes sys.path from |
1724 # This looks redundant with how Python initializes sys.path from |
1718 # the location of the script being executed. Needed because the |
1725 # the location of the script being executed. Needed because the |