summaryrefslogtreecommitdiffstats
path: root/Demo/scripts/from.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-03-30 11:14:20 (GMT)
committerGuido van Rossum <guido@python.org>1992-03-30 11:14:20 (GMT)
commit01ae0a68ca09d9c769b36c4360627e76ee331ec8 (patch)
tree29af2d8615e320964dcb8bbcdd1b5d5918e92e23 /Demo/scripts/from.py
parente7b88e7402b3683afeec3ed602dd53288772991c (diff)
downloadcpython-01ae0a68ca09d9c769b36c4360627e76ee331ec8.zip
cpython-01ae0a68ca09d9c769b36c4360627e76ee331ec8.tar.gz
cpython-01ae0a68ca09d9c769b36c4360627e76ee331ec8.tar.bz2
change posix to os; and change error message
Diffstat (limited to 'Demo/scripts/from.py')
-rwxr-xr-xDemo/scripts/from.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Demo/scripts/from.py b/Demo/scripts/from.py
index 8e663f1..394af8d 100755
--- a/Demo/scripts/from.py
+++ b/Demo/scripts/from.py
@@ -4,15 +4,14 @@
# Extension to multiple mailboxes and other bells & whistles are left
# as exercises for the reader.
-import sys, posix
+import sys, os
# Open mailbox file. Exits with exception when this fails.
try:
- mailbox = posix.environ['MAIL']
-except RuntimeError:
- sys.stderr.write \
- ('Please set environment variable MAIL to your mailbox\n')
+ mailbox = os.environ['MAIL']
+except (AttributeError, KeyError):
+ sys.stderr.write('No environment variable $MAIL\n')
sys.exit(2)
try: