Patchwork run-tests: endswith takes bytes as argument in python3, not str

login
register
mail settings
Submitter matthieu.laneuville@octobus.net
Date Nov. 3, 2017, 12:19 p.m.
Message ID <25d1eb7275ba4b95fbb4.1509711580@carbon>
Download mbox | patch
Permalink /patch/25373/
State Accepted
Headers show

Comments

matthieu.laneuville@octobus.net - Nov. 3, 2017, 12:19 p.m.
# HG changeset patch
# User Matthieu Laneuville <matthieu.laneuville@octobus.net>
# Date 1509711297 -32400
#      Fri Nov 03 21:14:57 2017 +0900
# Node ID 25d1eb7275ba4b95fbb4240672a3ad6578ab5b87
# Parent  7ebf850d3166a64ff33b4b85adb481b533ddbf86
run-tests: endswith takes bytes as argument in python3, not str
Yuya Nishihara - Nov. 3, 2017, 2:12 p.m.
On Fri, 03 Nov 2017 21:19:40 +0900, matthieu.laneuville@octobus.net wrote:
> # HG changeset patch
> # User Matthieu Laneuville <matthieu.laneuville@octobus.net>
> # Date 1509711297 -32400
> #      Fri Nov 03 21:14:57 2017 +0900
> # Node ID 25d1eb7275ba4b95fbb4240672a3ad6578ab5b87
> # Parent  7ebf850d3166a64ff33b4b85adb481b533ddbf86
> run-tests: endswith takes bytes as argument in python3, not str

Queued, thanks.

Patch

diff -r 7ebf850d3166 -r 25d1eb7275ba tests/run-tests.py
--- a/tests/run-tests.py	Sat Oct 21 16:50:57 2017 +0900
+++ b/tests/run-tests.py	Fri Nov 03 21:14:57 2017 +0900
@@ -2356,8 +2356,8 @@  class TestRunner(object):
         # assume all tests in same folder for now
         if testdescs:
             pathname = os.path.dirname(testdescs[0]['path'])
-            if pathname and not osenvironb[b'TESTDIR'].endswith('/'):
-                osenvironb[b'TESTDIR'] += '/'
+            if pathname and not osenvironb[b'TESTDIR'].endswith(b'/'):
+                osenvironb[b'TESTDIR'] += b'/'
             osenvironb[b'TESTDIR'] += pathname
         if self.options.outputdir:
             self._outputdir = canonpath(_bytespath(self.options.outputdir))