I've been tasked with updating a number of scripts that we run over night as scheduled tasks. The original scripts use several try: except blocks that look like this:
<SPAN class="keyword token">if</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Exists<SPAN class="punctuation token">(</SPAN>gdbPathNameTestBAK<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Delete_management<SPAN class="punctuation token">(</SPAN>gdbPathNameTestBAK<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Success: Deleted BACKUP "</SPAN> <SPAN class="operator token">+</SPAN> gdbPathNameTestBAK
<SPAN class="keyword token">except</SPAN> Exception<SPAN class="punctuation token">,</SPAN> ErrorDesc<SPAN class="punctuation token">:</SPAN>
errorFlag <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
EmailNoticeDeleteBack <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Error: No Delete BACKUP "</SPAN> <SPAN class="operator token">+</SPAN> gdbPathNameTestBAK
<SPAN class="keyword token">print</SPAN> str<SPAN class="punctuation token">(</SPAN>ErrorDesc<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">"Error: No Delete BACKUP "</SPAN> <SPAN class="operator token">+</SPAN> gdbPathNameTestBAK
<SPAN class="comment token"># note the except Exception, ErrorDesc:</SPAN>
EmailNoticeExportXML <SPAN class="operator