Merge "Define runfiles_path before try so that finally can use it."

This commit is contained in:
Nicolas Geoffray
2018-10-17 13:11:02 +00:00
committed by Gerrit Code Review

View File

@@ -41,6 +41,7 @@ def Main():
args = sys.argv[1:] args = sys.argv[1:]
new_env = {} new_env = {}
runfiles_path = None
try: try:
runfiles_path = ExtractRunfiles() runfiles_path = ExtractRunfiles()
@@ -82,7 +83,8 @@ def Main():
except: except:
raise raise
finally: finally:
shutil.rmtree(runfiles_path, True) if runfiles_path is not None:
shutil.rmtree(runfiles_path, True)
if __name__ == '__main__': if __name__ == '__main__':
Main() Main()