"Martin v. Löwis" <[EMAIL PROTECTED]> writes: >> 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()? > > Even though this would be somewhat lying - I'd put it into > msvcrt.set_error_mode. For the _CrtSet functions, one might > expose them as-is; they do belong to msvcrt, so the module > would be the proper place. For SetErrorMode, still put it > into msvcrt - it's at least Windows-specific.
For SetErrorMode, if you're just looking for a non-ctypes wrapping, it's already covered by pywin32's win32api, which seems simple enough to obtain (and likely to already be present) if you're working at this level with Win32 calls as a user of Python. Nor is ctypes very complicated as a fallback. I'm not sure this is a common enough a call to need a built-in wrapping. For this particular case of wanting to use it when developing Python itself, it actually feels a bit more appropriate to me to make the call external to the Python executable under test since it's really a behavior being imposed by the test environment. If a mechanism was implemented to have Python issue the call itself, I'd probably limit it to this specific use case. -- David _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com