From 6c18ba25ccdc3f3efc38e7b2c8293b89e4498ecf Mon Sep 17 00:00:00 2001 From: Matthew Suozzo Date: Thu, 6 Jan 2022 18:45:32 -0500 Subject: Use MappingProxyType to ensure immutability. --- pkg_resources/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg_resources') diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 6d0e19d6..f98516d1 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -3047,7 +3047,7 @@ class DistInfoDistribution(Distribution): if not req.marker or req.marker.evaluate({'extra': extra}): yield req - common = dict.fromkeys(reqs_for_extra(None)) + common = types.MappingProxyType(dict.fromkeys(reqs_for_extra(None))) dm[None].extend(common) for extra in self._parsed_pkg_info.get_all('Provides-Extra') or []: -- cgit v1.2.1