<div dir="ltr">Ah, I think that I misunderstood.  You're specifically talking about how to change the VTK examples?<div><br></div><div>In your sample code, if a VTK method has merely been deprecated, then the exception won't be triggered (unless VTK was configured with VTK_LEGACY_REMOVE.)  So you would still get the deprecation warning popping up in the dialog box.</div><div><br></div><div> - David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 20, 2017 at 11:38 PM, Andrew Maclean <span dir="ltr"><<a href="mailto:andrew.amaclean@gmail.com" target="_blank">andrew.amaclean@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">I know that they already print a warning but I wanted those using older versions of VTK to note that the change is coming up.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">Also often when running tests the warning is displayed very briefly. For example when using <b><i>vtk.test.Testing</i></b> I want to basically just use <b><i>vtk.vtkOutputWindow()</i></b> for important messages and still alert users to the future change if they are running old versions of VTK by reading the code or perhaps printing to the console.<br>I hope this makes sense!<br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Sep 21, 2017 at 3:17 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Andrew,<div><br></div><div>Deprecated methods already print a warning if they are declared with VTK_LEGACY().  Is there a reason that we would want the methods to live longer in Python than they do in C++?</div><span class="m_5766906793863073743HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="m_5766906793863073743HOEnZb"><font color="#888888"> - David</font></span><span><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 20, 2017 at 5:55 PM, Andrew Maclean <span dir="ltr"><<a href="mailto:andrew.amaclean@gmail.com" target="_blank">andrew.amaclean@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:small">What is the best way to handle deprecated methods?</div><div style="font-size:small"><br></div><div style="font-size:small">I'm thinking of doing this:</div><div style="font-size:small"><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold">try</span>:<br>    windowToImageFilter.SetScale(<span style="color:rgb(0,0,255)">1</span><wbr>)<br><span style="color:rgb(0,0,128);font-weight:bold">except </span><span style="color:rgb(0,0,128)">NameError</span>:<br>    <span style="color:rgb(0,0,128)">print</span>(<span style="color:rgb(0,128,128);font-weight:bold">'windowToImageFilter.Set<wbr>Magnification() is deeprecated in VTK8.1'</span>)<br>    windowToImageFilter.SetMagnifi<wbr>cation(<span style="color:rgb(0,0,255)">1</span>)<br></pre></div><div><div style="font-size:small">The thinking here is that if a deprecated method is ultimately removed, this will still work.</div><div style="font-size:small">​Any better ideas?​</div></div></div></blockquote></div><br></div></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="">-- <br><div class="m_5766906793863073743gmail_signature" data-smartmail="gmail_signature">______________________________<wbr>_____________<br>Andrew J. P. Maclean<br><br>______________________________<wbr>_____________</div>
</span></div>
</blockquote></div><br></div>