Alpha support for Monterey/macOS 12

This commit is contained in:
Rhet Turnbull
2021-06-29 13:32:36 -07:00
parent d034605784
commit 08147e91d9
217 changed files with 2122 additions and 32 deletions

View File

@@ -587,6 +587,11 @@ def get_preferred_uti_extension(uti):
def get_uti_for_extension(extension):
"""get UTI for a given file extension"""
# accepts extension with or without leading 0
if extension[0] == ".":
extension = extension[1:]
if (OS_VER, OS_MAJOR) <= (10, 16):
# https://developer.apple.com/documentation/coreservices/1448939-uttypecreatepreferredidentifierf
with objc.autorelease_pool():