diff options
author | Guido van Rossum <guido@python.org> | 1997-05-08 23:11:52 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-05-08 23:11:52 (GMT) |
commit | 6dd87830d091673741a4aabfb0680ae5ca64c257 (patch) | |
tree | e6f672d41d4a9ad178b970ef032f35d2eab9454d /Lib/mailbox.py | |
parent | 56f78d9e3c3a143a0b7ca5a56069dff9c3a9a872 (diff) | |
download | cpython-6dd87830d091673741a4aabfb0680ae5ca64c257.zip cpython-6dd87830d091673741a4aabfb0680ae5ca64c257.tar.gz cpython-6dd87830d091673741a4aabfb0680ae5ca64c257.tar.bz2 |
Improve getting the mailbox from the environment.
Diffstat (limited to 'Lib/mailbox.py')
-rwxr-xr-x | Lib/mailbox.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 36f58f5..2d0254e 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -142,12 +142,12 @@ def _test(): args = sys.argv[1:] if not args: - if os.environ.has_key('MAIL'): - mbox = os.environ['MAIL'] - elif os.environ.has_key('MAIL'): - mbox = os.environ['USER'] + for key in 'MAIL', 'LOGNAME', 'USER': + if os.environ.has_key(key): + mbox = os.environ[key] + break else: - print "Who are you?" + print "$MAIL, $LOGNAME nor $USER set -- who are you?" return else: mbox = args[0] |