Staging
v0.5.1
https://github.com/python/cpython
Revision 91e742fb6bb59c5a787f4b8a2584fdab4d82dd73 authored by Tim Peters on 27 February 2006, 17:47:02 UTC, committed by Tim Peters on 27 February 2006, 17:47:02 UTC
Patch 1413181, by Gabriel Becedillas.

PyThreadState_Delete():  if the auto-GIL-state machinery knows about
the thread state, forget it (since the thread state is being deleted,
continuing to remember it can't help, but can hurt if another thread
happens to get created with the same thread id).
1 parent 05b9254
Raw File
Tip revision: 91e742fb6bb59c5a787f4b8a2584fdab4d82dd73 authored by Tim Peters on 27 February 2006, 17:47:02 UTC
Merge rev 42607 from the trunk.
Tip revision: 91e742f
test_errno.py
#! /usr/bin/env python
"""Test the errno module
   Roger E. Masse
"""

import errno
from test.test_support import verbose

errors = ['E2BIG', 'EACCES', 'EADDRINUSE', 'EADDRNOTAVAIL', 'EADV',
          'EAFNOSUPPORT', 'EAGAIN', 'EALREADY', 'EBADE', 'EBADF',
          'EBADFD', 'EBADMSG', 'EBADR', 'EBADRQC', 'EBADSLT',
          'EBFONT', 'EBUSY', 'ECHILD', 'ECHRNG', 'ECOMM',
          'ECONNABORTED', 'ECONNREFUSED', 'ECONNRESET',
          'EDEADLK', 'EDEADLOCK', 'EDESTADDRREQ', 'EDOM',
          'EDQUOT', 'EEXIST', 'EFAULT', 'EFBIG', 'EHOSTDOWN',
          'EHOSTUNREACH', 'EIDRM', 'EILSEQ', 'EINPROGRESS',
          'EINTR', 'EINVAL', 'EIO', 'EISCONN', 'EISDIR',
          'EL2HLT', 'EL2NSYNC', 'EL3HLT', 'EL3RST', 'ELIBACC',
          'ELIBBAD', 'ELIBEXEC', 'ELIBMAX', 'ELIBSCN', 'ELNRNG',
          'ELOOP', 'EMFILE', 'EMLINK', 'EMSGSIZE', 'EMULTIHOP',
          'ENAMETOOLONG', 'ENETDOWN', 'ENETRESET', 'ENETUNREACH',
          'ENFILE', 'ENOANO', 'ENOBUFS', 'ENOCSI', 'ENODATA',
          'ENODEV', 'ENOENT', 'ENOEXEC', 'ENOLCK', 'ENOLINK',
          'ENOMEM', 'ENOMSG', 'ENONET', 'ENOPKG', 'ENOPROTOOPT',
          'ENOSPC', 'ENOSR', 'ENOSTR', 'ENOSYS', 'ENOTBLK',
          'ENOTCONN', 'ENOTDIR', 'ENOTEMPTY', 'ENOTOBACCO', 'ENOTSOCK',
          'ENOTTY', 'ENOTUNIQ', 'ENXIO', 'EOPNOTSUPP',
          'EOVERFLOW', 'EPERM', 'EPFNOSUPPORT', 'EPIPE',
          'EPROTO', 'EPROTONOSUPPORT', 'EPROTOTYPE',
          'ERANGE', 'EREMCHG', 'EREMOTE', 'ERESTART',
          'EROFS', 'ESHUTDOWN', 'ESOCKTNOSUPPORT', 'ESPIPE',
          'ESRCH', 'ESRMNT', 'ESTALE', 'ESTRPIPE', 'ETIME',
          'ETIMEDOUT', 'ETOOMANYREFS', 'ETXTBSY', 'EUNATCH',
          'EUSERS', 'EWOULDBLOCK', 'EXDEV', 'EXFULL']

#
# This is a wee bit bogus since the module only conditionally adds
# errno constants if they have been defined by errno.h  However, this
# test seems to work on SGI, Sparc & intel Solaris, and linux.
#
for error in errors:
    try:
        a = getattr(errno, error)
    except AttributeError:
        if verbose:
            print '%s: not found' % error
    else:
        if verbose:
            print '%s: %d' % (error, a)
back to top