File: _find_fuse_parts.py

package info (click to toggle)
python-fuse 2%3A1.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 368 kB
  • sloc: ansic: 1,388; python: 1,378; makefile: 25; sh: 10
file content (24 lines) | stat: -rw-r--r-- 713 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys, glob
from os.path import realpath, dirname, join
from traceback import format_exception

PYTHON_MAJOR_MINOR = "%s.%s" % (sys.version_info[0], sys.version_info[1])

ddd = realpath(join(dirname(sys.argv[0]), '..'))

for d in [ddd, '.']:
    for p in glob.glob(join(d, 'build', 'lib.*%s' % PYTHON_MAJOR_MINOR)):
        sys.path.insert(0, p)

try:
    import fuse
except ImportError:
    raise RuntimeError("""

! Got exception:
""" + "".join([ "> " + x for x in format_exception(*sys.exc_info()) ]) + """
! Have you ran `python setup.py build'?
!
! We've done our best to find the necessary components of the FUSE bindings
! even if it's not installed, we've got no clue what went wrong for you...
""")