Hi Karen, Karen Tung wrote: > Hi Keith, > > Thank you so much for the code review. Please see my responses below: > >> >> install_utils.py: >> >> 695: The 'finally' clause will close this file before the return, so >> this line isn't needed. (Did you consider using the "with" syntax for >> opening files? I find it provides a cleaner way to manage >> opening/closing files.) > > Since I am returning at line 696, I am not sure whether the finally > clause will get executed. I know the > finally clause will get executed if we continue with the rest of the > function. I am not sure what will > happen if I return. I do it here immediately > before I return to make sure. So, you are sure that it will? If so, > I can remove this.
"finally" clauses always get executed, no matter how the 'try' clause exits (whether it exits 'normally,' from an exception, or via return statement). - Keith
