mirror of
https://github.com/grahampugh/macadmin-scripts.git
synced 2025-12-17 17:56:33 +00:00
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
This commit is contained in:
parent
7a74bc37e3
commit
7c6621ec3e
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
#
|
#
|
||||||
# Copyright 2017 Greg Neagle.
|
# Copyright 2017 Greg Neagle.
|
||||||
@ -41,7 +41,13 @@ except ImportError:
|
|||||||
from urlparse import urlsplit
|
from urlparse import urlsplit
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
from xml.parsers.expat import ExpatError
|
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 = {
|
DEFAULT_SUCATALOGS = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user