Skip to content

Commit

Permalink
Compare ctypes COM method wrappers with 'is None' instead of
Browse files Browse the repository at this point in the history
requesting their boolean value.  This should be more robust (some
Python2.6 beta versions had a bug that COM methods were False).

--HG--
extra : convert_revision : svn%3Aa2f44796-8cc0-49ac-b43f-6a96d556d52d/trunk%40390
  • Loading branch information
theller committed Aug 19, 2008
1 parent 70f7ba8 commit 1c54ce3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions comtypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def _make_dispmethods(self, methods):

for (name, nargs), methods in properties.items():
# methods contains [propget or None, propput or None, propputref or None]
if methods[1] and methods[2]:
if methods[1] is not None and methods[2] is not None:
# both propput and propputref.
#
# Create a setter method that examines the argument type
Expand All @@ -430,7 +430,7 @@ def put_or_putref(self, *args):
return propput(self, *args)
methods[1] = put_or_putref
del methods[2]
elif methods[2]:
elif methods[2] is not None:
# use propputref
del methods[1]
else:
Expand Down Expand Up @@ -681,7 +681,7 @@ def _make_methods(self, methods):
# create public properties / attribute accessors
for (name, doc, nargs), methods in properties.items():
# methods contains [propget or None, propput or None, propputref or None]
if methods[1] and methods[2]:
if methods[1] is not None and methods[2] is not None:
# both propput and propputref.
#
# Create a setter method that examines the argument type
Expand All @@ -696,7 +696,7 @@ def put_or_putref(self, *args):
return propput(self, *args)
methods[1] = put_or_putref
del methods[2]
elif methods[2]:
elif methods[2] is not None:
# use propputref
del methods[1]
else:
Expand Down

0 comments on commit 1c54ce3

Please sign in to comment.