diff options
| author | Adam Hupp <adam@hupp.org> | 2014-12-01 09:38:44 -0800 |
|---|---|---|
| committer | Adam Hupp <adam@hupp.org> | 2014-12-01 09:38:44 -0800 |
| commit | 3664686df1e8e202bc449083d68ff0035ece63ea (patch) | |
| tree | fd72ecde93b2c6d30f5ed30fee380c47fd73e85b | |
| parent | 9aa1274a6574d7015448617cb88a68c40ad8edff (diff) | |
| parent | a1c1e5ca09cf2e729410352bc7c268f2834ab703 (diff) | |
| download | python-magic-3664686df1e8e202bc449083d68ff0035ece63ea.tar.gz | |
Merge pull request #68 from EugeneSusla/master
Fixed 'ImportError: failed to find libmagic. Check your installation' when using cygwin's python
| -rw-r--r-- | magic.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -159,11 +159,13 @@ if dll: libmagic = ctypes.CDLL(dll) if not libmagic or not libmagic._name: + windows_dlls = ['magic1.dll','cygmagic-1.dll'] platform_to_lib = {'darwin': ['/opt/local/lib/libmagic.dylib', '/usr/local/lib/libmagic.dylib'] + # Assumes there will only be one version installed glob.glob('/usr/local/Cellar/libmagic/*/lib/libmagic.dylib'), - 'win32': ['magic1.dll','cygmagic-1.dll']} + 'win32': windows_dlls, + 'cygwin': windows_dlls } for dll in platform_to_lib.get(sys.platform, []): try: libmagic = ctypes.CDLL(dll) |
