From: Oleg Broytman Date: Wed, 4 Feb 2015 19:22:45 +0000 (+0300) Subject: init.py: fix using defaults X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a35652e9895040987c1b13831c58afbaf652c8a2;p=dotfiles.git init.py: fix using defaults --- 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()