From a35652e9895040987c1b13831c58afbaf652c8a2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 4 Feb 2015 22:22:45 +0300 Subject: [PATCH] init.py: fix using defaults --- lib/python/init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/init.py b/lib/python/init.py index 23e950b..cc3b66b 100644 --- a/lib/python/init.py +++ b/lib/python/init.py @@ -212,7 +212,7 @@ def init(): return "Usage: pager('filename')" def __call__(self, filename): - pager = os.environ["PAGER"] or 'more' + pager = os.environ.get("PAGER") or 'more' os.system("%s '%s'" % (pager, filename.replace("'", '"\'"'))) __builtin__.pager = _Pager() @@ -223,7 +223,7 @@ def init(): return "Usage: edit('filename')" def __call__(self, filename): - editor = os.environ["VISUAL"] or os.environ["EDITOR"] or 'vi' + editor = os.environ.get("VISUAL") or os.environ.get("EDITOR") or 'vi' os.system("%s '%s'" % (editor, filename.replace("'", '"\'"'))) __builtin__.edit = __builtin__.editor = _Editor() -- 2.39.5