]> git.phdru.name Git - dotfiles.git/commitdiff
init.py: fix using defaults
authorOleg Broytman <phd@phdru.name>
Wed, 4 Feb 2015 19:22:45 +0000 (22:22 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 4 Feb 2015 19:22:45 +0000 (22:22 +0300)
lib/python/init.py

index 23e950b92cd495c079d3c909e00cfd1c8890a094..cc3b66be214e070336213d0d703fd40305b40fe4 100644 (file)
@@ -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()