Show More
@@ -19,6 +19,12 b" if os.name == 'nt':" | |||
|
19 | 19 | SYSTEM_KERNEL_DIR = None |
|
20 | 20 | else: |
|
21 | 21 | SYSTEM_KERNEL_DIR = "/usr/share/ipython/kernels" |
|
22 | ||
|
23 | # List of kernel directories to search. Later ones take priority over earlier. | |
|
24 | kernel_dirs = [ | |
|
25 | SYSTEM_KERNEL_DIR, | |
|
26 | USER_KERNEL_DIR, | |
|
27 | ] | |
|
22 | 28 | |
|
23 | 29 | NATIVE_KERNEL_NAME = 'python3' if PY3 else 'python2' |
|
24 | 30 | |
@@ -85,8 +91,9 b' def _make_native_kernel_dir():' | |||
|
85 | 91 | |
|
86 | 92 | def list_kernel_specs(): |
|
87 | 93 | """Returns a dict mapping kernel names to resource directories.""" |
|
88 | d = _list_kernels_in(SYSTEM_KERNEL_DIR) | |
|
89 | d.update(_list_kernels_in(USER_KERNEL_DIR)) | |
|
94 | d = {} | |
|
95 | for kernel_dir in kernel_dirs: | |
|
96 | d.update(_list_kernels_in(kernel_dir)) | |
|
90 | 97 | |
|
91 | 98 | if NATIVE_KERNEL_NAME not in d: |
|
92 | 99 | d[NATIVE_KERNEL_NAME] = _make_native_kernel_dir() |
General Comments 0
You need to be logged in to leave comments.
Login now