mirror of https://github.com/python/cpython.git
change posix to os; and change error message
This commit is contained in:
parent
e7b88e7402
commit
01ae0a68ca
|
@ -4,15 +4,14 @@
|
||||||
# Extension to multiple mailboxes and other bells & whistles are left
|
# Extension to multiple mailboxes and other bells & whistles are left
|
||||||
# as exercises for the reader.
|
# as exercises for the reader.
|
||||||
|
|
||||||
import sys, posix
|
import sys, os
|
||||||
|
|
||||||
# Open mailbox file. Exits with exception when this fails.
|
# Open mailbox file. Exits with exception when this fails.
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mailbox = posix.environ['MAIL']
|
mailbox = os.environ['MAIL']
|
||||||
except RuntimeError:
|
except (AttributeError, KeyError):
|
||||||
sys.stderr.write \
|
sys.stderr.write('No environment variable $MAIL\n')
|
||||||
('Please set environment variable MAIL to your mailbox\n')
|
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue