Patchwork py3: add b'' to some run-tests.py strings for Windows

login
register
mail settings
Submitter Matt Harbison
Date Sept. 13, 2018, 1:34 a.m.
Message ID <dfb052baace5510876f5.1536802485@Envy>
Download mbox | patch
Permalink /patch/34588/
State Accepted
Headers show

Comments

Matt Harbison - Sept. 13, 2018, 1:34 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1536802328 14400
#      Wed Sep 12 21:32:08 2018 -0400
# Node ID dfb052baace5510876f56e67f49b082273ebb858
# Parent  2105ed5ef206052a5ff093fba8cbd44bef470f20
py3: add b'' to some run-tests.py strings for Windows

Things go seriously off the rails after this, so there may be more that are
missing.

# skip-blame since these are just converting to bytes literals
Gregory Szorc - Sept. 13, 2018, 1:41 a.m.
On Wed, Sep 12, 2018 at 6:36 PM Matt Harbison <mharbison72@gmail.com> wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1536802328 14400
> #      Wed Sep 12 21:32:08 2018 -0400
> # Node ID dfb052baace5510876f56e67f49b082273ebb858
> # Parent  2105ed5ef206052a5ff093fba8cbd44bef470f20
> py3: add b'' to some run-tests.py strings for Windows
>

Queued, thanks.


>
> Things go seriously off the rails after this, so there may be more that are
> missing.
>
> # skip-blame since these are just converting to bytes literals
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -3118,8 +3118,8 @@ class TestRunner(object):
>      def _checktools(self):
>          """Ensure tools required to run tests are present."""
>          for p in self.REQUIREDTOOLS:
> -            if os.name == 'nt' and not p.endswith('.exe'):
> -                p += '.exe'
> +            if os.name == 'nt' and not p.endswith(b'.exe'):
> +                p += b'.exe'
>              found = self._findprogram(p)
>              if found:
>                  vlog("# Found prerequisite", p, "at", found)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -3118,8 +3118,8 @@  class TestRunner(object):
     def _checktools(self):
         """Ensure tools required to run tests are present."""
         for p in self.REQUIREDTOOLS:
-            if os.name == 'nt' and not p.endswith('.exe'):
-                p += '.exe'
+            if os.name == 'nt' and not p.endswith(b'.exe'):
+                p += b'.exe'
             found = self._findprogram(p)
             if found:
                 vlog("# Found prerequisite", p, "at", found)