From b1a7802d4364fe0ee553f835ae725308dde155c0 Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Tue, 9 Nov 2021 18:51:17 -0800 Subject: [PATCH] Fine tune http_cache usage pattern --- msal/application.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/msal/application.py b/msal/application.py index 04ad5fd4..5d1406af 100644 --- a/msal/application.py +++ b/msal/application.py @@ -377,10 +377,8 @@ def __init__( with open(http_cache_filename, "rb") as f: persisted_http_cache = pickle.load(f) # Take a snapshot except ( - IOError, # A non-exist http cache file + FileNotFoundError, # Or IOError in Python 2 pickle.UnpicklingError, # A corrupted http cache file - EOFError, # An empty http cache file - AttributeError, ImportError, IndexError, # Other corruption ): persisted_http_cache = {} # Recover by starting afresh atexit.register(lambda: pickle.dump(