##// END OF EJS Templates
Deterministic sort for kernelspec list, better error for install
Thomas Kluyver -
Show More
@@ -16,7 +16,8 b' from .kernelspec import KernelSpecManager'
16 def _pythonfirst(s):
16 def _pythonfirst(s):
17 "Sort key function that will put strings starting with 'python' first."
17 "Sort key function that will put strings starting with 'python' first."
18 if s.startswith('python'):
18 if s.startswith('python'):
19 return ''
19 # Space is not valid in kernel names, so this should sort first
20 return ' ' + s
20 return s
21 return s
21
22
22 class ListKernelSpecs(BaseIPythonApplication):
23 class ListKernelSpecs(BaseIPythonApplication):
@@ -93,7 +94,7 b' class InstallKernelSpec(BaseIPythonApplication):'
93 print("Permission denied")
94 print("Permission denied")
94 self.exit(1)
95 self.exit(1)
95 elif e.errno == errno.EEXIST:
96 elif e.errno == errno.EEXIST:
96 print("A kernel spec named %r is already present" % self.kernel_name)
97 print("A kernel spec is already present at %s" % e.filename)
97 self.exit(1)
98 self.exit(1)
98 raise
99 raise
99
100
General Comments 0
You need to be logged in to leave comments. Login now