Message250680
> Is there a way people can set errno to zero from Python code?
> Or do we need to ship 3.5.1 already?
The only the thing that comes to mind is using ctypes based on the CRT's implementation of errno:
import ctypes
import errno
import time
ucrtbase = ctypes.CDLL('ucrtbase')
ucrtbase._errno.restype = ctypes.POINTER(ctypes.c_int)
c_errno = ucrtbase._errno().contents
>>> time.strftime('')
''
>>> c_errno.value = errno.EINVAL; time.strftime('')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid format string |
|
Date |
User |
Action |
Args |
2015-09-14 16:42:43 | eryksun | set | recipients:
+ eryksun, terry.reedy, belopolsky, vstinner, r.david.murray, skrah, zach.ware, steve.dower, JohnLeitch, brycedarling |
2015-09-14 16:42:43 | eryksun | set | messageid: <1442248963.63.0.227510213004.issue25092@psf.upfronthosting.co.za> |
2015-09-14 16:42:43 | eryksun | link | issue25092 messages |
2015-09-14 16:42:43 | eryksun | create | |
|