From: Guido van Rossum Date: Mon, 30 Mar 1992 11:14:20 +0000 (+0000) Subject: change posix to os; and change error message X-Git-Tag: v0.9.8~427 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=01ae0a68ca09d9c769b36c4360627e76ee331ec8;p=thirdparty%2FPython%2Fcpython.git change posix to os; and change error message --- diff --git a/Demo/scripts/from.py b/Demo/scripts/from.py index 8e663f16e158..394af8df2275 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: