diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2023-05-19 10:06:19 +0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-05-19 20:09:21 +0200 |
| commit | c673f3d0fe87f6e23a259c620fba7fc9e9d3621f (patch) | |
| tree | 6ba4a647fee55854425214b7f05a8f3ff51ef8d3 /python/tests | |
| parent | dde001ef7161a313e4fe43bb522e8ccc02dffa9e (diff) | |
| download | focaccia-qemu-c673f3d0fe87f6e23a259c620fba7fc9e9d3621f.tar.gz focaccia-qemu-c673f3d0fe87f6e23a259c620fba7fc9e9d3621f.zip | |
mkvenv: replace distlib.database with importlib.metadata/pkg_resources
importlib.metadata is just as good as distlib.database and a bit more battle-proven for "egg" based distributions, and in fact that is exactly why mkvenv.py is not using distlib.database to find entry points: it simply does not work for eggs. The only disadvantage of importlib.metadata is that it is not available by default before Python 3.8, so we need a fallback to pkg_resources (again, just like for the case of finding entry points). Do so to fix issues where incorrect egg metadata results in a JSONDecodeError. While at it, reuse the new _get_version function to diagnose an incorrect version of the package even if importlib.metadata is not available. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'python/tests')
0 files changed, 0 insertions, 0 deletions