File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1532,7 +1532,8 @@ def remove_lock(lock_name):
15321532 lock_path = det_lock_path (lock_name )
15331533 _log .info ("Removing lock %s..." , lock_path )
15341534 remove_dir (lock_path )
1535- global_lock_names .remove (lock_name )
1535+ if lock_name in global_lock_names :
1536+ global_lock_names .remove (lock_name )
15361537 _log .info ("Lock removed: %s" , lock_path )
15371538
15381539
Original file line number Diff line number Diff line change @@ -2431,6 +2431,9 @@ def test_locks(self):
24312431 ft .remove_lock (lock_name )
24322432 self .assertFalse (os .path .exists (lock_path ))
24332433
2434+ # no harm done if remove_lock is called if lock is already gone
2435+ ft .remove_lock (lock_name )
2436+
24342437 # check_lock just returns again after lock is removed
24352438 ft .check_lock (lock_name )
24362439
You can’t perform that action at this time.
0 commit comments