changeset 42815:197e7326b8b8

contrib: simplify the genosxversion.py command to find the hg libraries I forget what problem I ran into while trying to teach the makefile to use a non-system python. (It might have ben missing hg-evolve and/or keyring, but `check_output()` was raising an error.) This still isn't great because it will return non zero for something like the username not being set, even though we aren't asking for it. But I suppose it's still useful to simplify. Differential Revision: https://phab.mercurial-scm.org/D6753
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 20 Aug 2019 18:05:07 -0400
parents 2c4f656c8e9f
children fb84730d1c5a
files contrib/genosxversion.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/genosxversion.py	Sun Aug 18 02:28:42 2019 +0300
+++ b/contrib/genosxversion.py	Tue Aug 20 18:05:07 2019 -0400
@@ -2,14 +2,13 @@
 from __future__ import absolute_import, print_function
 
 import argparse
-import json
 import os
 import subprocess
 import sys
 
 # Always load hg libraries from the hg we can find on $PATH.
-hglib = json.loads(subprocess.check_output(
-    ['hg', 'debuginstall', '-Tjson']))[0]['hgmodules']
+hglib = subprocess.check_output(
+    ['hg', 'debuginstall', '-T', '{hgmodules}'])
 sys.path.insert(0, os.path.dirname(hglib))
 
 from mercurial import util