From eac061cac3867681190e52af30c10a62df6828a4 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Wed, 3 Jan 2024 22:29:11 +0100 Subject: [PATCH] =?UTF-8?q?`plistlib.readPlist()`=20is=20missing=20from=20?= =?UTF-8?q?Python=20=E2=89=A5=203.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function has been deprecated since Python 3.4, replaced by `plistlib.load()`. --- pkg_resources/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index ab6afe955d4..55d51fdfea8 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -414,10 +414,9 @@ def _macos_vers(_cache=[]): if version == '': plist = '/System/Library/CoreServices/SystemVersion.plist' if os.path.exists(plist): - if hasattr(plistlib, 'readPlist'): - plist_content = plistlib.readPlist(plist) - if 'ProductVersion' in plist_content: - version = plist_content['ProductVersion'] + plist_content = plistlib.load(plist) + if 'ProductVersion' in plist_content: + version = plist_content['ProductVersion'] _cache.append(version.split('.')) return _cache[0]