Skip to content

Commit ba2719a

Browse files
authored
Merge pull request #71 from AzureAD/persistence-error
Change PersistenceNotFound's base from OSError to IOError
2 parents 8605a95 + 5bad518 commit ba2719a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

msal_extensions/persistence.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ def _mkdir_p(path):
4848
# We do not aim to wrap every os-specific exception.
4949
# Here we define only the most common one,
5050
# otherwise caller would need to catch os-specific persistence exceptions.
51-
class PersistenceNotFound(OSError):
51+
class PersistenceNotFound(IOError): # Use IOError rather than OSError as base,
52+
# because historically an IOError was bubbled up and expected.
53+
# https://github.com/AzureAD/microsoft-authentication-extensions-for-python/blob/0.2.2/msal_extensions/token_cache.py#L38
54+
# Now we want to maintain backward compatibility even when using Python 2.x
55+
# It makes no difference in Python 3.3+ where IOError is an alias of OSError.
5256
def __init__(
5357
self,
5458
err_no=errno.ENOENT, message="Persistence not found", location=None):

0 commit comments

Comments
 (0)