diff options
| author | Artem Skoretskiy <artem.skoretskiy@gmail.com> | 2016-12-21 23:52:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-21 23:52:14 +0100 |
| commit | f6206535deca111375034e0277cf0e0aa9bd3fe1 (patch) | |
| tree | b8d1ca7603675c2019de433bd93b77f75a9c919d /magic.py | |
| parent | 7ac0c2cc3ef7c3af32a5c51b2187edbf58898a63 (diff) | |
| download | python-magic-f6206535deca111375034e0277cf0e0aa9bd3fe1.tar.gz | |
Added a fallback for Alpine to find library file
There are some Linuxes that have libraries search broken. This commit would add a reasonable fallback for these systems.
Otherwise python-magic does not work there having "magic" library installed and python-magic from Pypi.
Diffstat (limited to 'magic.py')
| -rw-r--r-- | magic.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -160,7 +160,9 @@ if not libmagic or not libmagic._name: # Assumes there will only be one version installed glob.glob('/usr/local/Cellar/libmagic/*/lib/libmagic.dylib'), 'win32': windows_dlls, - 'cygwin': windows_dlls } + 'cygwin': windows_dlls, + 'linux': 'libmagic.so.1', # fallback for some Linuxes (e.g. Alpine) where library search does not work + } for dll in platform_to_lib.get(sys.platform, []): try: libmagic = ctypes.CDLL(dll) |
