Author: Matti Picus <matti.pi...@gmail.com> Branch: more-cpyext Changeset: r97441:64d4dfe78eb4 Date: 2019-09-11 17:53 +0300 http://bitbucket.org/pypy/pypy/changeset/64d4dfe78eb4/
Log: add PyErr_SetFromWindowsErr, test needed diff --git a/pytime.h b/pypy/module/cpyext/include/pytime.h rename from pytime.h rename to pypy/module/cpyext/include/pytime.h diff --git a/pypy/module/cpyext/pyerrors.py b/pypy/module/cpyext/pyerrors.py --- a/pypy/module/cpyext/pyerrors.py +++ b/pypy/module/cpyext/pyerrors.py @@ -64,6 +64,11 @@ """This is a shorthand for PyErr_SetObject(type, Py_None).""" PyErr_SetObject(space, w_type, space.w_None) +if os.name == 'nt': + @cpython_api([rffi.INT_real], lltype.Void, error=CANNOT_FAIL) + def PyErr_SetFromWindowsErr(space, err): + PyErr_SetObject(space, space.w_OSError, space.newint(err)) + @cpython_api([], PyObject, result_borrowed=True) def PyErr_Occurred(space): state = space.fromcache(State) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit