diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-07-17 09:28:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 09:28:33 (GMT) |
commit | 5ecedbd26692b9fbdd7aad81b991869bf650f929 (patch) | |
tree | 443aec6660dfe3df13bb39cfddc6d24bd20438bc /Lib/sysconfig.py | |
parent | 7aa89e505d893cd5e6f33b84d66e5fa769089931 (diff) | |
download | cpython-5ecedbd26692b9fbdd7aad81b991869bf650f929.zip cpython-5ecedbd26692b9fbdd7aad81b991869bf650f929.tar.gz cpython-5ecedbd26692b9fbdd7aad81b991869bf650f929.tar.bz2 |
gh-106789: avoid importing pprint from sysconfig (#106790)
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 122d441..a8b5c5f 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -465,10 +465,14 @@ def _get_sysconfigdata_name(): f'_sysconfigdata_{sys.abiflags}_{sys.platform}_{multiarch}', ) +def _print_config_dict(d, stream): + print ("{", file=stream) + for k, v in sorted(d.items()): + print(f" {k!r}: {v!r},", file=stream) + print ("}", file=stream) def _generate_posix_vars(): """Generate the Python module containing build-time variables.""" - import pprint vars = {} # load the installed Makefile: makefile = get_makefile_filename() @@ -523,7 +527,7 @@ def _generate_posix_vars(): f.write('# system configuration generated and used by' ' the sysconfig module\n') f.write('build_time_vars = ') - pprint.pprint(vars, stream=f) + _print_config_dict(vars, stream=f) # Create file used for sys.path fixup -- see Modules/getpath.c with open('pybuilddir.txt', 'w', encoding='utf8') as f: |