|
7 | 7 | import musicbrainzngs
|
8 | 8 | import site
|
9 | 9 | import whipper
|
10 |
| -from distutils.sysconfig import get_python_lib |
11 | 10 | from whipper.command import cd, offset, drive, image, accurip, mblookup
|
12 | 11 | from whipper.command.basecommand import BaseCommand
|
13 | 12 | from whipper.common import common, directory, config
|
@@ -38,11 +37,16 @@ def main():
|
38 | 37 | # Find whipper's plugins paths (local paths have higher priority)
|
39 | 38 | plugins_p = [directory.data_path('plugins')] # local path (in $HOME)
|
40 | 39 | if hasattr(sys, 'real_prefix'): # no getsitepackages() in virtualenv
|
41 |
| - plugins_p.append( |
42 |
| - get_python_lib(plat_specific=False, standard_lib=False, |
43 |
| - prefix='/usr/local') + '/whipper/plugins') |
44 |
| - plugins_p.append(get_python_lib(plat_specific=False, |
45 |
| - standard_lib=False) + '/whipper/plugins') |
| 40 | + try: |
| 41 | + from distutils.sysconfig import get_python_lib |
| 42 | + plugins_p.append( |
| 43 | + get_python_lib(plat_specific=False, standard_lib=False, |
| 44 | + prefix='/usr/local') + '/whipper/plugins') |
| 45 | + plugins_p.append(get_python_lib(plat_specific=False, |
| 46 | + standard_lib=False) + '/whipper/plugins') |
| 47 | + except ModuleNotFoundError: |
| 48 | + logger.error("Failed to import distutils. Some plugins might " |
| 49 | + "be unavailable.") |
46 | 50 | else:
|
47 | 51 | plugins_p += [x + '/whipper/plugins' for x in site.getsitepackages()]
|
48 | 52 |
|
|
0 commit comments