mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Merge 3.5.
This commit is contained in:
commit
8113f490c5
2 changed files with 12 additions and 3 deletions
|
@ -2629,12 +2629,18 @@ PyDecType_FromSequenceExact(PyTypeObject *type, PyObject *v,
|
|||
|
||||
/* class method */
|
||||
static PyObject *
|
||||
dec_from_float(PyObject *dec, PyObject *pyfloat)
|
||||
dec_from_float(PyObject *type, PyObject *pyfloat)
|
||||
{
|
||||
PyObject *context;
|
||||
PyObject *result;
|
||||
|
||||
CURRENT_CONTEXT(context);
|
||||
return PyDecType_FromFloatExact((PyTypeObject *)dec, pyfloat, context);
|
||||
result = PyDecType_FromFloatExact(&PyDec_Type, pyfloat, context);
|
||||
if (!PyDec_CheckExact(type) && result != NULL) {
|
||||
Py_SETREF(result, PyObject_CallFunctionObjArgs(type, result, NULL));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* create_decimal_from_float */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue