diff options
Diffstat (limited to 'pkg_resources.py')
-rw-r--r-- | pkg_resources.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 6d96f5c2..6ec51fa0 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -191,9 +191,10 @@ def _macosx_vers(_cache=[]): import plistlib plist = '/System/Library/CoreServices/SystemVersion.plist' if os.path.exists(plist): - plist_content = plistlib.readPlist(plist) - if 'ProductVersion' in plist_content: - version = plist_content['ProductVersion'] + if hasattr(plistlib, 'readPlist'): + plist_content = plistlib.readPlist(plist) + if 'ProductVersion' in plist_content: + version = plist_content['ProductVersion'] _cache.append(version.split('.')) return _cache[0] |