Patchwork [2,of,5,STABLE] py3: pass bytes to `configint` and `configbool`

login
register
mail settings
Submitter Raphaël Gomès
Date Dec. 12, 2019, 4:46 p.m.
Message ID <697e5119ce5d2ae8c7ef.1576169186@alphare-carbon.lan>
Download mbox | patch
Permalink /patch/43745/
State New
Headers show

Comments

Raphaël Gomès - Dec. 12, 2019, 4:46 p.m.
# HG changeset patch
# User Raphaël Gomès <rgomes@octobus.net>
# Date 1574094884 -3600
#      Mon Nov 18 17:34:44 2019 +0100
# Branch stable
# Node ID 697e5119ce5d2ae8c7ef048a8a18e2b15c7af17a
# Parent  36425b06e091f8e6336358dba278ef3804e183fb
py3: pass bytes to `configint` and `configbool`

Both functions require bytes, even in Python 3.

Differential Revision: https://phab.mercurial-scm.org/D7453

Patch

diff -r 36425b06e091 -r 697e5119ce5d mercurial/dirstate.py
--- a/mercurial/dirstate.py	Sun Nov 10 07:30:14 2019 -0800
+++ b/mercurial/dirstate.py	Mon Nov 18 17:34:44 2019 +0100
@@ -1119,11 +1119,11 @@ 
             # Force Rayon (Rust parallelism library) to respect the number of
             # workers. This is a temporary workaround until Rust code knows
             # how to read the config file.
-            numcpus = self._ui.configint("worker", "numcpus")
+            numcpus = self._ui.configint(b"worker", b"numcpus")
             if numcpus is not None:
                 encoding.environ.setdefault(b'RAYON_NUM_THREADS', b'%d' % numcpus)
 
-            workers_enabled = self._ui.configbool("worker", "enabled", True)
+            workers_enabled = self._ui.configbool(b"worker", b"enabled", True)
             if not workers_enabled:
                 encoding.environ[b"RAYON_NUM_THREADS"] = b"1"