-
-
Notifications
You must be signed in to change notification settings - Fork 104
Closed
Labels
help wantedExtra attention is neededExtra attention is needed
Description
I was investigating the memory leak in #775 and came across this piece of code:
comtypes/comtypes/automation.py
Lines 252 to 283 in ddb2a1c
| elif isinstance(value, int): | |
| u = self._ | |
| # try VT_I4 first. | |
| u.VT_I4 = value | |
| if u.VT_I4 == value: | |
| # it did work. | |
| self.vt = VT_I4 | |
| return | |
| # try VT_UI4 next. | |
| if value >= 0: | |
| u.VT_UI4 = value | |
| if u.VT_UI4 == value: | |
| # did work. | |
| self.vt = VT_UI4 | |
| return | |
| # try VT_I8 next. | |
| if value >= 0: | |
| u.VT_I8 = value | |
| if u.VT_I8 == value: | |
| # did work. | |
| self.vt = VT_I8 | |
| return | |
| # try VT_UI8 next. | |
| if value >= 0: | |
| u.VT_UI8 = value | |
| if u.VT_UI8 == value: | |
| # did work. | |
| self.vt = VT_UI8 | |
| return | |
| # VT_R8 is last resort. | |
| self.vt = VT_R8 | |
| u.VT_R8 = float(value) |
It appears to be dead code since there's already an elif handling int:
comtypes/comtypes/automation.py
Lines 249 to 251 in ddb2a1c
| elif isinstance(value, (int, c_int)): | |
| self.vt = VT_I4 | |
| self._.VT_I4 = value |
Could this be removed?
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed