kenj wrote:
> [...]
> ! File "/usr/lib64/python2.6/site-packages/pcp/pmapi.py", line 2138, in
> __init__
> ! self.stss = stss_t(c_api.PM_ERR_VALUE)
> ! IndexError: invalid index
Interesting, that is meant to be an initialization, not an
index-operation; it must have changed between older & newer
python-ctypes. But it's redundant: the C pmfg also initializes those
variables. So, how about switching to:
diff --git a/src/python/pcp/pmapi.py b/src/python/pcp/pmapi.py
index 5e41f81a2ea3..09b6e4fb1078 100644
--- a/src/python/pcp/pmapi.py
+++ b/src/python/pcp/pmapi.py
@@ -2134,8 +2134,8 @@ LIBPCP.pmFetchGroup.argtypes = [c_void_p]
values_t = pmAtomValue * num
icodes_t = c_int * num
inames_t = c_char_p * num
- self.sts = c_int(c_api.PM_ERR_VALUE)
- self.stss = stss_t(c_api.PM_ERR_VALUE)
+ self.sts = c_int()
+ self.stss = stss_t()
self.pmtype = pmtype
self.values = values_t()
self.icodes = icodes_t()
@@ -2177,8 +2177,8 @@ LIBPCP.pmFetchGroup.argtypes = [c_void_p]
stss_t = c_int * num
values_t = pmAtomValue * num
timespec_t = timespec * num
- self.sts = c_int(c_api.PM_ERR_VALUE)
- self.stss = stss_t(c_api.PM_ERR_VALUE)
+ self.sts = c_int()
+ self.stss = stss_t()
self.pmtype = pmtype
self.times = timespec_t()
self.values = values_t()
- FChE
|