mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Fix a regression introduced by rev. 63792: ctypes function pointers
that are COM methods must have a boolean True value.
This commit is contained in:
parent
4348a25665
commit
0ad5ae02af
3 changed files with 35 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
import unittest
|
||||
import unittest, sys
|
||||
|
||||
from ctypes import *
|
||||
import _ctypes_test
|
||||
|
@ -183,5 +183,10 @@ class PointersTestCase(unittest.TestCase):
|
|||
self.failUnlessEqual(bool(CFUNCTYPE(None)(0)), False)
|
||||
self.failUnlessEqual(bool(CFUNCTYPE(None)(42)), True)
|
||||
|
||||
# COM methods are boolean True:
|
||||
if sys.platform == "win32":
|
||||
mth = WINFUNCTYPE(None)(42, "name", (), None)
|
||||
self.failUnlessEqual(bool(mth), True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue