# HG changeset patch # User Matt Harbison # Date 1721928673 14400 # Node ID e14ed26b72cb976d14be94fdf1da4b189880f070 # Parent 43460c311c0cd3b9407aef5714df5675148ab5c2 largefiles: avoid a potentially undefined variable in exception case The `wlock` variable is used to release the lock in the `finally` block, so it would be undefined if `repo.wlock()` itself failed. Caught by pytype 2024.04.11 with py3.10.11. diff -r 43460c311c0c -r e14ed26b72cb hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Wed Jul 24 22:40:22 2024 -0400 +++ b/hgext/largefiles/overrides.py Thu Jul 25 13:31:13 2024 -0400 @@ -825,11 +825,11 @@ if not os.path.isdir(makestandin(dest)): os.makedirs(makestandin(dest)) + # When we call orig below it creates the standins but we don't add + # them to the dir state until later so lock during that time. + wlock = repo.wlock() + try: - # When we call orig below it creates the standins but we don't add - # them to the dir state until later so lock during that time. - wlock = repo.wlock() - manifest = repo[None].manifest() def overridematch(