[issue40913] time.sleep ignores errors on Windows

Tim Golden report at bugs.python.org
Fri Jun 12 01:41:43 EDT 2020


Tim Golden <mail at timgolden.me.uk> added the comment:

Thanks, Eryk. I've had a couple of casts at this (and also with an eye to https://bugs.python.org/issue40912 in a very similar area).

Trouble is I can't come up with a way of adding a set.. function which doesn't seem wholly artificial, given that it's basically creating an anonymous event and checking its return. I can't come up with a non-testing scenario where the ability to override would be useful.

If I understand your proposal, a tentative "set..." function would have to take a HANDLE parameter so that it could be overridden by a test? That means its normal use would be something like:

setSigintEvent(CreateEvent(NULL, ....));

so either the error checking for that would be inside the function, which feels weird, or would happen outside, which feels like the functions not doing anything. (I appreciate I may be overthinking here).

I'm very much open to suggestions here, but it seems to me that either:

We make the (simple) change without tests;

or we add a setSigintEvent function as above whose only purpose is to be overridden -- and then only for testing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40913>
_______________________________________


More information about the Python-bugs-list mailing list