##// END OF EJS Templates
run-tests: unblock running python tests in python 3...
Augie Fackler -
r25058:caa2043c default
parent child Browse files
Show More
@@ -127,7 +127,7 b' def Popen4(cmd, wd, timeout, env=None):'
127
127
128 return p
128 return p
129
129
130 PYTHON = sys.executable.replace('\\', '/')
130 PYTHON = sys.executable.replace('\\', '/').encode('utf-8')
131 IMPL_PATH = b'PYTHONPATH'
131 IMPL_PATH = b'PYTHONPATH'
132 if 'java' in sys.platform:
132 if 'java' in sys.platform:
133 IMPL_PATH = b'JYTHONPATH'
133 IMPL_PATH = b'JYTHONPATH'
@@ -809,11 +809,11 b' class PythonTest(Test):'
809
809
810 @property
810 @property
811 def refpath(self):
811 def refpath(self):
812 return os.path.join(self._testdir, '%s.out' % self.name)
812 return os.path.join(self._testdir, b'%s.out' % self.bname)
813
813
814 def _run(self, env):
814 def _run(self, env):
815 py3kswitch = self._py3kwarnings and ' -3' or ''
815 py3kswitch = self._py3kwarnings and b' -3' or b''
816 cmd = '%s%s "%s"' % (PYTHON, py3kswitch, self.path)
816 cmd = b'%s%s "%s"' % (PYTHON, py3kswitch, self.path)
817 vlog("# Running", cmd)
817 vlog("# Running", cmd)
818 normalizenewlines = os.name == 'nt'
818 normalizenewlines = os.name == 'nt'
819 result = self._runcommand(cmd, env,
819 result = self._runcommand(cmd, env,
@@ -971,7 +971,7 b' class TTest(Test):'
971 # We've just entered a Python block. Add the header.
971 # We've just entered a Python block. Add the header.
972 inpython = True
972 inpython = True
973 addsalt(prepos, False) # Make sure we report the exit code.
973 addsalt(prepos, False) # Make sure we report the exit code.
974 script.append('%s -m heredoctest <<EOF\n' % PYTHON)
974 script.append(b'%s -m heredoctest <<EOF\n' % PYTHON)
975 addsalt(n, True)
975 addsalt(n, True)
976 script.append(l[2:])
976 script.append(l[2:])
977 elif l.startswith(b' ... '): # python inlines
977 elif l.startswith(b' ... '): # python inlines
@@ -1742,7 +1742,7 b' class TestRunner(object):'
1742 self._pythondir = os.path.join(self._installdir, b"lib", b"python")
1742 self._pythondir = os.path.join(self._installdir, b"lib", b"python")
1743
1743
1744 osenvironb[b"BINDIR"] = self._bindir
1744 osenvironb[b"BINDIR"] = self._bindir
1745 os.environ["PYTHON"] = PYTHON
1745 osenvironb[b"PYTHON"] = PYTHON
1746
1746
1747 fileb = __file__.encode('utf-8')
1747 fileb = __file__.encode('utf-8')
1748 runtestdir = os.path.abspath(os.path.dirname(fileb))
1748 runtestdir = os.path.abspath(os.path.dirname(fileb))
@@ -2097,8 +2097,11 b' class TestRunner(object):'
2097 if self._hgpath is not None:
2097 if self._hgpath is not None:
2098 return self._hgpath
2098 return self._hgpath
2099
2099
2100 cmd = '%s -c "import mercurial; print (mercurial.__path__[0])"'
2100 cmd = b'%s -c "import mercurial; print (mercurial.__path__[0])"'
2101 pipe = os.popen(cmd % PYTHON)
2101 cmd = cmd % PYTHON
2102 if sys.version_info[0] > 2:
2103 cmd = cmd.decode('utf-8')
2104 pipe = os.popen(cmd)
2102 try:
2105 try:
2103 self._hgpath = pipe.read().strip()
2106 self._hgpath = pipe.read().strip()
2104 if sys.version_info[0] == 3:
2107 if sys.version_info[0] == 3:
General Comments 0
You need to be logged in to leave comments. Login now