theller at ctypes.org
Thu Aug 30 09:25:06 CEST 2007
Martin v. Löwis schrieb:
>> New patch (still detects the debug build because the name of the C runtime
>> dll depends on it):
> I know it will be difficult to talk you into not using ctypes :-),
> I think this should go into the interpreter code itself. One problem
> with your patch is that it breaks if Python is build with VC8.
ctypes isn't perfect - it needs a way to reliably access the currently used
C runtime library on windows. But that is off-topic for this thread.
> It should still require an environment variable, say
> PYTHONNOERRORWINDOW, whether or not it should be considered only
> in debug releases, I don't know. One place to put it would be
> Modules/main.c (where all the other environment variables are
IMO all this is currently a hack for the buildbot only. Maybe it should be
converted into something more useful.
About debug release: The _CrtSetReport... functions are only available
in the debug libray. So, they have to live inside a #ifdef _DEBUG/#endif
The set_error_mode() function is more useful; AFAIK it also prevents that
a dialog box is shown when an extension module cannot be loaded because
the extension module depends on a dll that is not found or doesn't have the
entry points that the extension links to.
So, an environment variable would be useful, but maybe there should also be
a Python function available that calls set_error_mode(). sys.set_error_mode()?
More information about the Python-3000