prevent itf
to be an unbound variable in _cominterface_meta.__get_baseinterface_methodcount
#472
Labels
good first issue
Good for newcomers
Milestone
Since
itf
can be an unbound variable, the following code will cause several type checkers to warn.comtypes/comtypes/_post_coinit/unknwn.py
Lines 325 to 336 in 97cbe1c
But this
try...except...
clause traps aKeyError
.Therefore, it is possible to change to a better code by verifying the existence of the key.
Maybe
vars(itf)
is better thanitf.__dict__
, or maybe there is another way to write it better, but I'll leave it to the contributors for fixing this.The text was updated successfully, but these errors were encountered: