We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf21065 commit 0a2fda3Copy full SHA for 0a2fda3
1 file changed
magic/loader.py
@@ -49,7 +49,9 @@ def _lib_candidates():
49
"darwin": _lib_candidates_macos,
50
"linux": _lib_candidates_linux,
51
"win32": _lib_candidates_windows,
52
- }[sys.platform]
+ }.get(sys.platform)
53
+ if func is None:
54
+ raise ImportError("python-magic: Unsupported platform: " + sys.platform)
55
# When we drop legacy Python, we can just `yield from func()`
56
for path in func():
57
yield path
@@ -65,4 +67,4 @@ def load_lib():
65
67
pass
66
68
69
# It is better to raise an ImportError since we are importing magic module
- raise ImportError("failed to find libmagic. Check your installation")
70
+ raise ImportError("python-magic: failed to find libmagic. Check your installation")
0 commit comments