Improvements to the python pmErr exception class
Improvements to the python pmErr exception class

The interaction between the pmLookupName PMAPI wrapper
and the exception class was not quite right.  Firstly
the test-for-failure in the lookup wrapper came after
the test-for-not-the-same-number-of-PMIDs-passed-in,
rendering the error case unreachable.  Secondly, the
value passed into the exception handler (which *must*
be an error code) was the positive return value, for
the case where some, but not all, names resolve.

This meant the error-symbol dictionary lookup would
fail and neither an error message nor the list of
names which didn't resolve would be generated - not
useful behaviour when handling exceptions.

Finally, when a pmContext constructor stalls (eg for
faraway connections) and is interrupted (eg killed),
the destructor is called with a partially-initialised
object.  It then attempts to call pmDestroyContext(3)
on an uninitialised context, and badness results.

These bugs were found while testing some new python
monitor tools, automated regression testing will be
added shortly using those new tools as the vehicle.

prasincs/pcp,edwardt/pcp,wuliming/pcp,adfernandes/pcp,andyvand/cygpcpfans,edwardt/pcp,aeg-aeg/pcpfans,edwardt/pcp,prasincs/pcp,adfernandes/pcp,tjanez/pcp,wuliming/pcp,aeg-aeg/pcpfans,tjanez/pcp,wuliming/pcp,aeg-aeg/pcpfans,wuliming/pcp,mbaldessari/pcp,edwardt/pcp,mbaldessari/pcp,tjanez/pcp,andyvand/cygpcpfans,tjanez/pcp,aeg-aeg/pcpfans,andyvand/cygpcpfans,prasincs/pcp,wuliming/pcp,prasincs/pcp,adfernandes/pcp,andyvand/cygpcpfans,wuliming/pcp,mbaldessari/pcp,edwardt/pcp,aeg-aeg/pcpfans,adfernandes/pcp,prasincs/pcp,adfernandes/pcp,adfernandes/pcp,mbaldessari/pcp,andyvand/cygpcpfans,prasincs/pcp,adfernandes/pcp,tjanez/pcp,aeg-aeg/pcpfans,edwardt/pcp,tjanez/pcp,andyvand/cygpcpfans,tjanez/pcp,andyvand/cygpcpfans,mbaldessari/pcp,prasincs/pcp,andyvand/cygpcpfans,edwardt/pcp,tjanez/pcp,edwardt/pcp,mbaldessari/pcp,wuliming/pcp,wuliming/pcp,aeg-aeg/pcpfans,aeg-aeg/pcpfans,adfernandes/pcp,prasincs/pcp