Commits

Guido van Rossum  committed a76a3a3

Don't just die when an error is not defined; print a warning instead.
This for errno-challenged platforms like Windows.

  • Participants
  • Parent commits d32b8f4
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/test/test_errno.py

 	  'ENODEV', 'ENOENT', 'ENOEXEC', 'ENOLCK', 'ENOLINK',
 	  'ENOMEM', 'ENOMSG', 'ENONET', 'ENOPKG', 'ENOPROTOOPT',
 	  'ENOSPC', 'ENOSR', 'ENOSTR', 'ENOSYS', 'ENOTBLK',
-	  'ENOTCONN', 'ENOTDIR', 'ENOTEMPTY', 'ENOTSOCK',
+	  'ENOTCONN', 'ENOTDIR', 'ENOTEMPTY', 'ENOTOBACCO', 'ENOTSOCK',
 	  'ENOTTY', 'ENOTUNIQ', 'ENXIO', 'EOPNOTSUPP',
 	  'EOVERFLOW', 'EPERM', 'EPFNOSUPPORT', 'EPIPE',
 	  'EPROTO', 'EPROTONOSUPPORT', 'EPROTOTYPE',
 # test seems to work on SGI, Sparc & intel Solaris, and linux.
 #
 for error in errors:
-    a = getattr(errno, error)
-    if verbose:
-	print '%s: %d' % (error, a)
+    try:
+	a = getattr(errno, error)
+    except AttributeError:
+	if verbose:
+	    print '%s: not found' % error
+    else:
+	if verbose:
+	    print '%s: %d' % (error, a)