]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
change posix to os; and change error message
authorGuido van Rossum <guido@python.org>
Mon, 30 Mar 1992 11:14:20 +0000 (11:14 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 30 Mar 1992 11:14:20 +0000 (11:14 +0000)
Demo/scripts/from.py

index 8e663f16e158c9794abd96606080826981e789c6..394af8df227541f7fd42bb464f98c5d7cf39e0d5 100755 (executable)
@@ -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: