File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -1409,17 +1409,20 @@ def cache_unlock(self, url):
1409
1409
1410
1410
lock_dir = os .path .join (cpath , '.lock' )
1411
1411
lock_file = os .path .join (lock_dir , 'pid' )
1412
- if os .path .exists (lock_dir ):
1413
- if os .path .isfile (lock_file ):
1414
- try :
1415
- with open (lock_file , 'r' , 0 ) as f :
1416
- pid = f .read (8 )
1417
- if int (pid ) != os .getpid ():
1418
- error ("Cache lock file exists with a different pid (\" %s\" vs \" %s\" )" % (pid , os .getpid ()))
1419
- except OSError :
1420
- error ("Unable to unlock cache dir \" %s\" " % (cpath ))
1421
- os .remove (lock_file )
1422
- os .rmdir (lock_dir )
1412
+ try :
1413
+ if os .path .exists (lock_dir ):
1414
+ if os .path .isfile (lock_file ):
1415
+ try :
1416
+ with open (lock_file , 'r' , 0 ) as f :
1417
+ pid = f .read (8 )
1418
+ if int (pid ) != os .getpid ():
1419
+ error ("Cache lock file exists with a different pid (\" %s\" vs \" %s\" )" % (pid , os .getpid ()))
1420
+ except OSError :
1421
+ error ("Unable to unlock cache dir \" %s\" " % (cpath ))
1422
+ os .remove (lock_file )
1423
+ os .rmdir (lock_dir )
1424
+ except (OSError ) as e :
1425
+ pass
1423
1426
return True
1424
1427
1425
1428
def pid_exists (self , pid ):
You can’t perform that action at this time.
0 commit comments