* Use PyObjC recommended pattern to call superclass init to fix #1183

* Use the pylint comments from gurl.
This commit is contained in:
Shea Craig
2023-07-26 17:07:38 -04:00
committed by GitHub
parent 2d64dcd17a
commit 3172d5dbb2

View File

@@ -35,6 +35,11 @@ import select
import socket
import sys
# builtin super doesn't work with Cocoa classes in recent PyObjC releases.
# pylint: disable=redefined-builtin,no-name-in-module
from objc import super
# pylint: enable=redefined-builtin,no-name-in-module
try:
# Apple frameworks
from AppKit import NSWorkspace
@@ -114,7 +119,7 @@ class NotificationHandler(NSObject):
def init(self):
"""NSObject-compatible initializer"""
self = super(NotificationHandler, self).init()
self = super().init()
if self is None:
return None