##// END OF EJS Templates
Fall back to default editor if $EDITOR is non-ASCII....
Thomas Kluyver -
Show More
@@ -41,13 +41,19 b' from IPython.utils.traitlets import Integer, CBool, Unicode'
41 41 def get_default_editor():
42 42 try:
43 43 ed = os.environ['EDITOR']
44 if not py3compat.PY3:
45 ed = ed.decode()
46 return ed
44 47 except KeyError:
45 if os.name == 'posix':
46 ed = 'vi' # the only one guaranteed to be there!
47 else:
48 ed = 'notepad' # same in Windows!
49 return ed
50
48 pass
49 except UnicodeError:
50 warn("$EDITOR environment variable is not pure ASCII. Using platform "
51 "default editor.")
52
53 if os.name == 'posix':
54 return 'vi' # the only one guaranteed to be there!
55 else:
56 return 'notepad' # same in Windows!
51 57
52 58 def get_pasted_lines(sentinel, l_input=py3compat.input):
53 59 """ Yield pasted lines until the user enters the given sentinel value.
General Comments 0
You need to be logged in to leave comments. Login now