Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyright turn on reportOptionalCall #2285

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions com/win32comext/axscript/client/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

import re
import sys
from typing import NoReturn
from collections.abc import Callable
from typing import Any, NoReturn

import pythoncom # Need simple connection point support
import win32api
Expand Down Expand Up @@ -192,7 +193,9 @@ def __init__(self, myItem, coDispatch):
self.connection = None
self.coDispatch = coDispatch
self.myScriptItem = myItem
self.myInvokeMethod = myItem.GetEngine().ProcessScriptItemEvent
self.myInvokeMethod: Callable[[Any, Any, Any, Any, Any], Any] = (
myItem.GetEngine().ProcessScriptItemEvent
) # Incomplete type
self.iid = None

def Reset(self):
Expand All @@ -218,7 +221,7 @@ def _invoke_(self, dispid, lcid, wFlags, args):
event = self.events[dispid]
except:
raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND)
# print("Invoke for ", event, "on", self.myScriptItem, " - calling", self.myInvokeMethod)
# print("Invoke for", event, "on", self.myScriptItem, "- calling", self.myInvokeMethod)
return self.myInvokeMethod(self.myScriptItem, event, lcid, wFlags, args)

def GetSourceTypeInfo(self, typeinfo):
Expand Down
1 change: 0 additions & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// some of the fixes need to be done in types-pywin32 from typeshed
"reportCallIssue": "warning",
"reportOperatorIssue": "warning",
"reportOptionalCall": "warning",
"reportOptionalIterable": "warning",
"reportOptionalMemberAccess": "warning",
"reportOptionalSubscript": "warning",
Expand Down
Loading