Skip to content

Commit 163b64f

Browse files
committed
Refactor
1 parent b7a6753 commit 163b64f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bpython/config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ def default_config_path():
6868
return get_config_home() / "config"
6969

7070

71+
def default_editor():
72+
"""Returns the default editor."""
73+
return os.environ.get("VISUAL", os.environ.get("EDITOR", "vi"))
74+
75+
7176
def fill_config_with_default_values(config, default_values):
7277
for section in default_values.keys():
7378
if not config.has_section(section):
@@ -91,7 +96,7 @@ def loadini(struct, config_path):
9196
"complete_magic_methods": True,
9297
"dedent_after": 1,
9398
"default_autoreload": False,
94-
"editor": os.environ.get("VISUAL", os.environ.get("EDITOR", "vi")),
99+
"editor": default_editor(),
95100
"flush_output": True,
96101
"import_completion_skiplist": ":".join(
97102
(

0 commit comments

Comments
 (0)