Message342520
| Author |
Jeffrey.Kintscher |
| Recipients |
Jeffrey.Kintscher, amaury.forgeotdarc, belopolsky, lauri.alanko, meador.inge |
| Date |
2019年05月14日.21:35:57 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1557869757.35.0.855738087924.issue18060@roundup.psfhosted.org> |
| In-reply-to |
| Content |
While the fix works as advertised, it breaks a similar existing test case:
======================================================================
ERROR: test_positional_args (ctypes.test.test_structures.StructureTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jeff/sandbox/src/python3.7/cpython/Lib/ctypes/test/test_structures.py", line 390, in test_positional_args
z = Z(1, 2, 3, 4, 5, 6)
IndexError: list index out of range
----------------------------------------------------------------------
Below is the relevant test code:
class W(Structure):
_fields_ = [("a", c_int), ("b", c_int)]
class X(W):
_fields_ = [("c", c_int)]
class Y(X):
pass
class Z(Y):
_fields_ = [("d", c_int), ("e", c_int), ("f", c_int)]
z = Z(1, 2, 3, 4, 5, 6)
It similar but slightly different from the provided test case:
libm = CDLL(find_library('m'))
class Base(Structure):
_fields_ = [('y', c_double),
('x', c_double)]
class Mid(Base):
pass
Mid._fields_ = []
class Vector(Mid): pass
libm.atan2.argtypes = [Vector]
libm.atan2.restype = c_double
arg = Vector(y=0.0, x=-1.0)
I will do some more digging. |
|