Skip to content

Commit e90a146

Browse files
author
Tim Vaillancourt
committed
add a conditional to exception handler just in case
1 parent 0eede32 commit e90a146

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MongoBackup/Backup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ def cleanup_and_exit(self, code, frame):
145145

146146
logging.info("Cleanup complete. Exiting")
147147

148-
self._lock.release()
148+
if self._lock:
149+
self._lock.release()
150+
149151
sys.exit(1)
150152

151153
def exception(self, error_message):

0 commit comments

Comments
 (0)