Commit b608bdee authored by Chris Toshok's avatar Chris Toshok

implement PyNumber_Divmod to fix datetime.timedelta(0)

parent 4480e933
...@@ -1132,8 +1132,12 @@ extern "C" PyObject* PyNumber_Remainder(PyObject* lhs, PyObject* rhs) noexcept { ...@@ -1132,8 +1132,12 @@ extern "C" PyObject* PyNumber_Remainder(PyObject* lhs, PyObject* rhs) noexcept {
} }
} }
extern "C" PyObject* PyNumber_Divmod(PyObject*, PyObject*) noexcept { extern "C" PyObject* PyNumber_Divmod(PyObject* lhs, PyObject* rhs) noexcept {
try {
return binop(lhs, rhs, AST_TYPE::DivMod);
} catch (ExcInfo e) {
Py_FatalError("unimplemented"); Py_FatalError("unimplemented");
}
} }
extern "C" PyObject* PyNumber_Power(PyObject*, PyObject*, PyObject* o3) noexcept { extern "C" PyObject* PyNumber_Power(PyObject*, PyObject*, PyObject* o3) noexcept {
......
...@@ -5,3 +5,4 @@ import datetime ...@@ -5,3 +5,4 @@ import datetime
print repr(datetime.time()) print repr(datetime.time())
print datetime.datetime.__base__ print datetime.datetime.__base__
print repr(datetime.datetime(1, 2, 3)) print repr(datetime.datetime(1, 2, 3))
print str(datetime.timedelta(0))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment