Skip to content

Commit 5ad506d

Browse files
committed
Provide accurate msal[broker] version hint on Mac
1 parent f51ef86 commit 5ad506d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

msal/broker.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@
2323
except (ImportError, AttributeError): # AttributeError happens when a prior pymsalruntime uninstallation somehow leaved an empty folder behind
2424
# PyMsalRuntime currently supports these Windows versions, listed in this MSFT internal link
2525
# https://github.com/AzureAD/microsoft-authentication-library-for-cpp/pull/2406/files
26-
raise ImportError('You need to install dependency by: pip install "msal[broker]>=1.20,<2"')
26+
min_ver = {
27+
"win32": "1.20",
28+
"darwin": "1.31",
29+
}.get(sys.platform)
30+
if min_ver:
31+
raise ImportError(
32+
f'You must install dependency by: pip install "msal[broker]>={min_ver},<2"')
33+
else: # Unsupported platform
34+
raise ImportError("Dependency pymsalruntime unavailable on current platform")
2735
# It could throw RuntimeError when running on ancient versions of Windows
2836

2937

0 commit comments

Comments
 (0)