<div dir="ltr"><div>I apologize... the bits I saw the "< 0" testing were in the following link. The examples in the repo don't have either try/catch or the int testing such as in the second link.</div><div><br></div><a href="https://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Guest_Domains-Lifecycle_Control.html#libvirt_application_development_guide_using_python-Guest_Domains-Lifecycle-Provisioning_and_Starting">https://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Guest_Domains-Lifecycle_Control.html#libvirt_application_development_guide_using_python-Guest_Domains-Lifecycle-Provisioning_and_Starting</a><br><div><br></div><div><a href="https://gitlab.com/libvirt/libvirt-python/-/blob/d8d55b17e227f0ce829e709966f580861186f8ab/examples/domsave.py#L29">https://gitlab.com/libvirt/libvirt-python/-/blob/d8d55b17e227f0ce829e709966f580861186f8ab/examples/domsave.py#L29</a><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 24, 2020 at 6:09 AM Michal Privoznik <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 8/24/20 11:38 AM, Jeremy Markle wrote:<br>
> I was simply following the examples in the python-libvirt repo. If those <br>
> methods raise exceptions I'll definitely change to try/catch. Thank you. <br>
> The maintainer of the repo should update the examples and documentation <br>
> if exceptions are raised by those.<br>
> <br>
<br>
Can you be more specific please? A quick git grep shows only a few cases <br>
which don't compare APIs rather than some integer variables:<br>
<br>
libvirt-python.git $ git grep -C 3 -e '< 0' --or -e '== 0' -- examples/<br>
<br>
And those try/catch statements - in our basic examples we don't do any <br>
rollback and simply just let python abort.<br>
<br>
Michal<br>
<br>
</blockquote></div>