REDROOM
PHP 8.5.2
Path:
Logout
Edit File
Size: 1.14 KB
Close
//lib/python3/dist-packages/magic/loader.py
Text
Base64
from ctypes.util import find_library import ctypes import sys import glob import os.path def _lib_candidates(): yield find_library('magic') if sys.platform == 'darwin': paths = [ '/opt/local/lib', '/usr/local/lib', '/opt/homebrew/lib', ] + glob.glob('/usr/local/Cellar/libmagic/*/lib') for i in paths: yield os.path.join(i, 'libmagic.dylib') elif sys.platform in ('win32', 'cygwin'): prefixes = ['libmagic', 'magic1', 'cygmagic-1', 'libmagic-1', 'msys-magic-1'] for i in prefixes: # find_library searches in %PATH% but not the current directory, # so look for both yield './%s.dll' % (i,) yield find_library(i) elif sys.platform == 'linux': # This is necessary because alpine is bad yield 'libmagic.so.1' def load_lib(): for lib in _lib_candidates(): # find_library returns None when lib not found if lib is None: continue try: return ctypes.CDLL(lib) except OSError: pass else: # It is better to raise an ImportError since we are importing magic module raise ImportError('failed to find libmagic. Check your installation')
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-01-08 12:56:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
compat.py
8.12 KB
lrw-r--r--
2022-06-07 19:50:57
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
loader.py
1.14 KB
lrw-r--r--
2022-06-07 19:50:57
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
py.typed
0 B
lrw-r--r--
2022-06-07 19:50:57
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
14.61 KB
lrw-r--r--
2022-06-07 19:50:57
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.pyi
2.45 KB
lrw-r--r--
2022-06-07 19:50:57
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).