()
| 62 | } |
| 63 | |
| 64 | def get_default_editor(): |
| 65 | try: |
| 66 | return os.environ['EDITOR'] |
| 67 | except KeyError: |
| 68 | pass |
| 69 | except UnicodeError: |
| 70 | warn("$EDITOR environment variable is not pure ASCII. Using platform " |
| 71 | "default editor.") |
| 72 | |
| 73 | if os.name == 'posix': |
| 74 | return 'vi' # the only one guaranteed to be there! |
| 75 | else: |
| 76 | return 'notepad' # same in Windows! |
| 77 | |
| 78 | # conservatively check for tty |
| 79 | # overridden streams can result in things like: |
no outgoing calls
no test coverage detected