Re: [PATCH 3/4] Change thread_to_thread_object to return a new reference

Tom Tromey
2018-09-16T15:35:46Z

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> I think it is best to have a single style - returning NULL should also
Tom> set the Python exception.

Maybe the gdbpy_ref (1-argument) constructor and release methods could
assert that the Python exception is set if the underlying pointer is
NULL. That would not get full checking but maybe it would catch some
problems. And maybe we should simply use gdbpy_ref in many more places
in the Python layer -- ideally, reserve raw pointers solely for
parameters which are borrowed references.

Tom