Skip to content

Commit b7800d0

Browse files
author
guido
committed
change posix to os; and change error message
git-svn-id: http://svn.python.org/projects/python/trunk@2919 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 58cc7ee commit b7800d0

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Demo/scripts/from.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
# Extension to multiple mailboxes and other bells & whistles are left
55
# as exercises for the reader.
66

7-
import sys, posix
7+
import sys, os
88

99
# Open mailbox file. Exits with exception when this fails.
1010

1111
try:
12-
mailbox = posix.environ['MAIL']
13-
except RuntimeError:
14-
sys.stderr.write \
15-
('Please set environment variable MAIL to your mailbox\n')
12+
mailbox = os.environ['MAIL']
13+
except (AttributeError, KeyError):
14+
sys.stderr.write('No environment variable $MAIL\n')
1615
sys.exit(2)
1716

1817
try:

0 commit comments

Comments
 (0)