Skip to content

Commit 6881f41

Browse files
committed
compile: read git_remote from the [scm] section
The example configuration (`doc/benchmark.conf.sample`) and the configuration in `test_commands.py` both expect it to be there. Add a fallback in case anyone has existing configurations with it set under `[config]`.
1 parent 727a0aa commit 6881f41

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pyperformance/compile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,12 @@ def getint(section, key, default=None):
797797
# [scm]
798798
conf.repo_dir = getfile('scm', 'repo_dir')
799799
conf.update = getboolean('scm', 'update', True)
800-
conf.git_remote = getstr('config', 'git_remote', default='remotes/origin')
800+
try:
801+
conf.git_remote = getstr('scm', 'git_remote')
802+
except KeyError:
803+
# This key used to live under `config`. Fall back there
804+
# for backwards-compatibility.
805+
conf.git_remote = getstr('config', 'git_remote', default='remotes/origin')
801806

802807
# [compile]
803808
conf.directory = getfile('compile', 'bench_dir')

0 commit comments

Comments
 (0)