Skip to content

Commit

Permalink
Provide accurate msal[broker] version hint on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
rayluo committed Oct 5, 2024
1 parent f51ef86 commit 5ad506d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion msal/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@
except (ImportError, AttributeError): # AttributeError happens when a prior pymsalruntime uninstallation somehow leaved an empty folder behind
# PyMsalRuntime currently supports these Windows versions, listed in this MSFT internal link
# https://github.com/AzureAD/microsoft-authentication-library-for-cpp/pull/2406/files
raise ImportError('You need to install dependency by: pip install "msal[broker]>=1.20,<2"')
min_ver = {
"win32": "1.20",
"darwin": "1.31",
}.get(sys.platform)
if min_ver:
raise ImportError(
f'You must install dependency by: pip install "msal[broker]>={min_ver},<2"')
else: # Unsupported platform
raise ImportError("Dependency pymsalruntime unavailable on current platform")
# It could throw RuntimeError when running on ancient versions of Windows


Expand Down

0 comments on commit 5ad506d

Please sign in to comment.