Avoid deprecation warning from Apple
Apparently Apple invent half-assed language extensions like @available and then dont implement them properly
This commit is contained in:
parent
ae6318cb5a
commit
889f2fce6d
@ -231,7 +231,7 @@ cocoa_send_notification(PyObject *self UNUSED, PyObject *args) {
|
|||||||
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
|
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
|
||||||
UNNotificationPresentationOptions options = UNNotificationPresentationOptionSound;
|
UNNotificationPresentationOptions options = UNNotificationPresentationOptionSound;
|
||||||
if (@available(macOS 11.0, *)) options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner;
|
if (@available(macOS 11.0, *)) options |= UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner;
|
||||||
else options |= UNNotificationPresentationOptionAlert;
|
else options |= (1 << 2); // UNNotificationPresentationOptionAlert avoid deprecated warning
|
||||||
completionHandler(options);
|
completionHandler(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user