X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=lib%2Fpython%2Finit.py;h=cc3b66be214e070336213d0d703fd40305b40fe4;hb=a35652e9895040987c1b13831c58afbaf652c8a2;hp=23e950b92cd495c079d3c909e00cfd1c8890a094;hpb=f73bf0e01400402069c32b432fd9acdd665a084f;p=dotfiles.git 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()