cpython/Lib/ctypes/test
Thomas Heller 9cac7b6117 Merged revisions 63977 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63977 | thomas.heller | 2008-06-06 10:33:46 +0200 (Fri, 06 Jun 2008) | 31 lines

  Issue #1798: Add ctypes calling convention that allows safe access of errno.

  ctypes maintains thread-local storage that has space for two error
  numbers: private copies of the system 'errno' value and, on Windows,
  the system error code accessed by the GetLastError() and
  SetLastError() api functions.

  Foreign functions created with CDLL(..., use_errno=True), when called,
  swap the system 'errno' value with the private copy just before the
  actual function call, and swapped again immediately afterwards.  The
  'use_errno' parameter defaults to False, in this case 'ctypes_errno'
  is not touched.

  On Windows, foreign functions created with CDLL(...,
  use_last_error=True) or WinDLL(..., use_last_error=True) swap the
  system LastError value with the ctypes private copy.

  The values are also swapped immeditately before and after ctypes
  callback functions are called, if the callbacks are constructed using
  the new optional use_errno parameter set to True: CFUNCTYPE(...,
  use_errno=TRUE) or WINFUNCTYPE(..., use_errno=True).

  New ctypes functions are provided to access the ctypes private copies
  from Python:

  - ctypes.set_errno(value) and ctypes.set_last_error(value) store
    'value' in the private copy and returns the previous value.

  - ctypes.get_errno() and ctypes.get_last_error() returns the current
    ctypes private copies value.
........
2008-06-06 09:31:40 +00:00
..
__init__.py Merged revisions 63897-63898 via svnmerge from 2008-06-06 09:11:46 +00:00
runtests.py Merged revisions 63395-63396,63511,63522-63523 via svnmerge from 2008-05-23 17:26:46 +00:00
test_anon.py Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
test_array_in_pointer.py Merging the py3k-pep3137 branch back into the py3k branch. 2007-11-06 21:34:58 +00:00
test_arrays.py Whoops, I missed a few more places that were using slicing from the operator module 2008-03-17 20:50:44 +00:00
test_as_parameter.py Fix various spots where int/long and str/unicode unification 2007-05-03 21:05:51 +00:00
test_bitfields.py SF patch 1631942 by Collin Winter: 2007-01-10 16:19:56 +00:00
test_buffers.py Patch #1318 by Amaury Forgeot d'Arc. 2007-10-24 18:41:19 +00:00
test_bytes.py c_char, c_char_p objects and c_char array structure fields return 2007-07-13 12:52:51 +00:00
test_byteswap.py Merging the py3k-pep3137 branch back into the py3k branch. 2007-11-06 21:34:58 +00:00
test_callbacks.py Removed the API to create unbound methods and simplified the API for bound methods. The signature is PyMethod_New(func, instance). 2007-11-27 10:40:20 +00:00
test_cast.py Merged revisions 57620-57771 via svnmerge from 2007-08-30 22:15:33 +00:00
test_cfuncs.py Merged revisions 58742-58816 via svnmerge from 2007-11-02 23:46:40 +00:00
test_checkretval.py Merged revisions 60990-61002 via svnmerge from 2008-02-23 18:30:17 +00:00
test_delattr.py Merged revisions 59541-59561 via svnmerge from 2007-12-19 02:07:34 +00:00
test_errcheck.py
test_errno.py Merged revisions 63977 via svnmerge from 2008-06-06 09:31:40 +00:00
test_find.py Merged revisions 60990-61002 via svnmerge from 2008-02-23 18:30:17 +00:00
test_frombuffer.py Merged revisions 62425-62429,62434-62436,62441,62444,62446-62448,62450-62455,62463,62465-62466,62469,62474,62476-62478,62480,62485,62492,62497-62498,62500,62507,62513-62514,62516,62521,62531,62535,62545-62546,62548-62551,62553-62559,62569,62574,62577,62593,62595,62604-62606,62608,62616,62626-62627,62636,62638,62644-62645,62647-62648,62651-62653,62656,62661,62663,62680,62686-62687,62696,62699-62703,62711 via svnmerge from 2008-05-04 22:42:01 +00:00
test_funcptr.py Merged revisions 60383-60407 via svnmerge from 2008-01-29 12:18:50 +00:00
test_functions.py Merged revisions 58742-58816 via svnmerge from 2007-11-02 23:46:40 +00:00
test_incomplete.py
test_init.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
test_integers.py
test_internals.py Changes in anticipation of stricter str vs. bytes enforcement. 2007-08-27 17:23:59 +00:00
test_keeprefs.py Fix a ctypes test. 2007-07-12 12:05:40 +00:00
test_libc.py Merged revisions 60990-61002 via svnmerge from 2008-02-23 18:30:17 +00:00
test_loading.py Merged revisions 63395-63396,63511,63522-63523 via svnmerge from 2008-05-23 17:26:46 +00:00
test_macholib.py Raise statement normalization in Lib/ctypes/. 2007-08-30 03:47:13 +00:00
test_memfunctions.py Patch #1318 by Amaury Forgeot d'Arc. 2007-10-24 18:41:19 +00:00
test_numbers.py Merged revisions 60990-61002 via svnmerge from 2008-02-23 18:30:17 +00:00
test_objects.py c_char, c_char_p objects and c_char array structure fields return 2007-07-13 12:52:51 +00:00
test_parameters.py c_char_p.from_param accepts bytes. Fix test_parameters. 2007-07-12 19:33:24 +00:00
test_pep3118.py Merged revisions 60056-60071,60073-60127,60129-60261,60263-60284,60286-62589,62591-62594 via svnmerge from 2008-04-30 17:11:46 +00:00
test_pickling.py Merged revisions 60767,60768 via svnmerge from 2008-02-13 20:40:44 +00:00
test_pointers.py Merged revisions 63791-63792 via svnmerge from 2008-05-29 19:54:39 +00:00
test_prototypes.py A 'PyObject *' parameter in PyErr_Format must use %S parameter, not %s. 2007-10-24 19:37:27 +00:00
test_python_api.py fix failing test from rename 2008-05-26 14:39:04 +00:00
test_random_things.py Raise statement normalization in Lib/ctypes/. 2007-08-30 03:47:13 +00:00
test_refcounts.py
test_repr.py Merged revisions 57778-58052 via svnmerge from 2007-09-08 17:39:28 +00:00
test_returnfuncptrs.py Patch #1318 by Amaury Forgeot d'Arc. 2007-10-24 18:41:19 +00:00
test_simplesubclasses.py Restructure comparison dramatically. There is no longer a default 2006-08-24 00:41:19 +00:00
test_sizes.py
test_slicing.py Whoops, I missed a few more places that were using slicing from the operator module 2008-03-17 20:50:44 +00:00
test_stringptr.py Fix the ctypes tests. Patch from Victor Stinner. He writes: 2007-08-08 18:47:32 +00:00
test_strings.py Patch #1318 by Amaury Forgeot d'Arc. 2007-10-24 18:41:19 +00:00
test_struct_fields.py
test_structures.py Bug #2565: The repr() of type objects now calls them 'class', 2008-04-07 05:43:42 +00:00
test_unaligned_structures.py
test_unicode.py Patch #1318 by Amaury Forgeot d'Arc. 2007-10-24 18:41:19 +00:00
test_values.py Add a comment to explain why we have to restore the original value. 2007-12-12 20:01:44 +00:00
test_varsize_struct.py Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
test_win32.py Merged revisions 56301-56442 via svnmerge from 2007-07-18 18:15:48 +00:00