Staging
v0.5.1
v0.5.1
https://github.com/python/cpython
Revision 9cac7b6117a61aac15c9d5ea3b85e7d3d5097a69 authored by Thomas Heller on 06 June 2008, 09:31:40 UTC, committed by Thomas Heller on 06 June 2008, 09:31:40 UTC
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. ........
1 parent 311c16a
Tip revision: 9cac7b6117a61aac15c9d5ea3b85e7d3d5097a69 authored by Thomas Heller on 06 June 2008, 09:31:40 UTC
Merged revisions 63977 via svnmerge from
Merged revisions 63977 via svnmerge from
Tip revision: 9cac7b6
File | Mode | Size |
---|---|---|
_ctypes | ||
_sqlite | ||
cjkcodecs | ||
expat | ||
zlib | ||
Setup.config.in | -rw-r--r-- | 408 bytes |
Setup.dist | -rw-r--r-- | 14.7 KB |
_bisectmodule.c | -rw-r--r-- | 5.9 KB |
_bsddb.c | -rw-r--r-- | 166.0 KB |
_bytesio.c | -rw-r--r-- | 20.0 KB |
_codecsmodule.c | -rw-r--r-- | 29.2 KB |
_collectionsmodule.c | -rw-r--r-- | 33.8 KB |
_csv.c | -rw-r--r-- | 42.1 KB |
_curses_panel.c | -rw-r--r-- | 12.3 KB |
_cursesmodule.c | -rw-r--r-- | 79.2 KB |
_dbmmodule.c | -rw-r--r-- | 9.7 KB |
_elementtree.c | -rw-r--r-- | 70.5 KB |
_fileio.c | -rw-r--r-- | 19.1 KB |
_functoolsmodule.c | -rw-r--r-- | 7.9 KB |
_gdbmmodule.c | -rw-r--r-- | 14.7 KB |
_gestalt.c | -rw-r--r-- | 2.3 KB |
_hashopenssl.c | -rw-r--r-- | 14.7 KB |
_heapqmodule.c | -rw-r--r-- | 18.7 KB |
_json.c | -rw-r--r-- | 19.7 KB |
_localemodule.c | -rw-r--r-- | 17.9 KB |
_lsprof.c | -rw-r--r-- | 23.4 KB |
_randommodule.c | -rw-r--r-- | 13.9 KB |
_sre.c | -rw-r--r-- | 96.8 KB |
_ssl.c | -rw-r--r-- | 42.5 KB |
_struct.c | -rw-r--r-- | 49.9 KB |
_testcapimodule.c | -rw-r--r-- | 30.8 KB |
_threadmodule.c | -rw-r--r-- | 18.6 KB |
_tkinter.c | -rw-r--r-- | 69.3 KB |
_weakref.c | -rw-r--r-- | 3.1 KB |
addrinfo.h | -rw-r--r-- | 5.7 KB |
ar_beos | -rwxr-xr-x | 1.8 KB |
arraymodule.c | -rw-r--r-- | 52.8 KB |
atexitmodule.c | -rw-r--r-- | 6.3 KB |
audioop.c | -rw-r--r-- | 57.8 KB |
binascii.c | -rw-r--r-- | 41.8 KB |
bsddb.h | -rw-r--r-- | 7.7 KB |
bz2module.c | -rw-r--r-- | 48.3 KB |
cmathmodule.c | -rw-r--r-- | 32.4 KB |
config.c.in | -rw-r--r-- | 1.4 KB |
cryptmodule.c | -rw-r--r-- | 1.2 KB |
datetimemodule.c | -rw-r--r-- | 136.2 KB |
errnomodule.c | -rw-r--r-- | 23.2 KB |
fcntlmodule.c | -rw-r--r-- | 15.8 KB |
fpectlmodule.c | -rw-r--r-- | 10.9 KB |
fpetestmodule.c | -rw-r--r-- | 5.5 KB |
gc_weakref.txt | -rw-r--r-- | 11.2 KB |
gcmodule.c | -rw-r--r-- | 39.3 KB |
getaddrinfo.c | -rw-r--r-- | 15.5 KB |
getbuildinfo.c | -rw-r--r-- | 1.0 KB |
getnameinfo.c | -rw-r--r-- | 5.5 KB |
getpath.c | -rw-r--r-- | 22.2 KB |
grpmodule.c | -rw-r--r-- | 4.7 KB |
itertoolsmodule.c | -rw-r--r-- | 72.9 KB |
ld_so_aix | -rwxr-xr-x | 6.0 KB |
ld_so_beos | -rwxr-xr-x | 1.8 KB |
main.c | -rw-r--r-- | 16.0 KB |
makesetup | -rwxr-xr-x | 7.3 KB |
makexp_aix | -rwxr-xr-x | 3.2 KB |
mathmodule.c | -rw-r--r-- | 30.2 KB |
md5module.c | -rw-r--r-- | 14.7 KB |
mmapmodule.c | -rw-r--r-- | 33.4 KB |
nismodule.c | -rw-r--r-- | 9.4 KB |
operator.c | -rw-r--r-- | 19.9 KB |
ossaudiodev.c | -rw-r--r-- | 31.9 KB |
parsermodule.c | -rw-r--r-- | 89.9 KB |
posixmodule.c | -rw-r--r-- | 185.3 KB |
pwdmodule.c | -rw-r--r-- | 4.8 KB |
pyexpat.c | -rw-r--r-- | 60.4 KB |
python.c | -rw-r--r-- | 1.6 KB |
readline.c | -rw-r--r-- | 23.8 KB |
resource.c | -rw-r--r-- | 8.6 KB |
rotatingtree.c | -rw-r--r-- | 2.8 KB |
rotatingtree.h | -rw-r--r-- | 901 bytes |
selectmodule.c | -rw-r--r-- | 46.6 KB |
sha1module.c | -rw-r--r-- | 13.8 KB |
sha256module.c | -rw-r--r-- | 21.8 KB |
sha512module.c | -rw-r--r-- | 27.5 KB |
signalmodule.c | -rw-r--r-- | 22.3 KB |
socketmodule.c | -rw-r--r-- | 126.6 KB |
socketmodule.h | -rw-r--r-- | 6.3 KB |
spwdmodule.c | -rw-r--r-- | 4.6 KB |
sre.h | -rw-r--r-- | 2.6 KB |
sre_constants.h | -rw-r--r-- | 2.4 KB |
symtablemodule.c | -rw-r--r-- | 2.4 KB |
syslogmodule.c | -rw-r--r-- | 6.7 KB |
termios.c | -rw-r--r-- | 18.4 KB |
testcapi_long.h | -rw-r--r-- | 4.2 KB |
timemodule.c | -rw-r--r-- | 27.4 KB |
tkappinit.c | -rw-r--r-- | 4.0 KB |
unicodedata.c | -rw-r--r-- | 34.0 KB |
unicodedata_db.h | -rw-r--r-- | 348.9 KB |
unicodename_db.h | -rw-r--r-- | 939.3 KB |
xxmodule.c | -rw-r--r-- | 9.1 KB |
xxsubtype.c | -rw-r--r-- | 7.4 KB |
yuv.h | -rw-r--r-- | 2.5 KB |
yuvconvert.c | -rw-r--r-- | 3.0 KB |
zipimport.c | -rw-r--r-- | 30.6 KB |
zlibmodule.c | -rw-r--r-- | 29.0 KB |
Computing file changes ...