From 7c6621ec3ed8827ab33dc382ee572349fc886bda Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 1 Feb 2022 14:11:14 -0800 Subject: [PATCH] Prep for removal of Apple Python in macOS 12.3: - Change shebang to #!/usr/bin/env python - Print error and possible fix if xattr module is not available --- installinstallmacos.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/installinstallmacos.py b/installinstallmacos.py index 4eb4b61..d914a93 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # encoding: utf-8 # # Copyright 2017 Greg Neagle. @@ -41,7 +41,13 @@ except ImportError: from urlparse import urlsplit from xml.dom import minidom from xml.parsers.expat import ExpatError -import xattr + +try: + import xattr +except ImportError: + print("This tool requires the Python xattr module. " + "Perhaps run `pip install xattr` to install it.") + sys.exit(-1) DEFAULT_SUCATALOGS = {