mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-38631: Avoid Py_FatalError() in float.__getformat__() (GH-17232)
Replace Py_FatalError() with a regular RuntimeError exception in float.__getformat__().
This commit is contained in:
parent
f49f6baa6b
commit
04394df74b
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
Replace ``Py_FatalError()`` call with a regular :exc:`RuntimeError`
|
||||||
|
exception in :meth:`float.__getformat__`.
|
|
@ -1726,7 +1726,8 @@ float___getformat___impl(PyTypeObject *type, const char *typestr)
|
||||||
case ieee_big_endian_format:
|
case ieee_big_endian_format:
|
||||||
return PyUnicode_FromString("IEEE, big-endian");
|
return PyUnicode_FromString("IEEE, big-endian");
|
||||||
default:
|
default:
|
||||||
Py_FatalError("insane float_format or double_format");
|
PyErr_SetString(PyExc_RuntimeError,
|
||||||
|
"insane float_format or double_format");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue