Commit c7162a0e authored by Guido van Rossum's avatar Guido van Rossum

Improve getting the mailbox from the environment.

parent 7410bb43
...@@ -142,12 +142,12 @@ def _test(): ...@@ -142,12 +142,12 @@ def _test():
args = sys.argv[1:] args = sys.argv[1:]
if not args: if not args:
if os.environ.has_key('MAIL'): for key in 'MAIL', 'LOGNAME', 'USER':
mbox = os.environ['MAIL'] if os.environ.has_key(key):
elif os.environ.has_key('MAIL'): mbox = os.environ[key]
mbox = os.environ['USER'] break
else: else:
print "Who are you?" print "$MAIL, $LOGNAME nor $USER set -- who are you?"
return return
else: else:
mbox = args[0] mbox = args[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment