mirror of
https://github.com/python/cpython.git
synced 2025-10-11 17:32:49 +00:00
gh-103731: Remove unneeded checks for TCL_WIDE_INT_TYPE (GH-103732)
This commit is contained in:
parent
ccd4253752
commit
6e850c30bb
1 changed files with 0 additions and 4 deletions
|
@ -911,16 +911,13 @@ AsObj(PyObject *value)
|
||||||
if (PyLong_CheckExact(value)) {
|
if (PyLong_CheckExact(value)) {
|
||||||
int overflow;
|
int overflow;
|
||||||
long longValue;
|
long longValue;
|
||||||
#ifdef TCL_WIDE_INT_TYPE
|
|
||||||
Tcl_WideInt wideValue;
|
Tcl_WideInt wideValue;
|
||||||
#endif
|
|
||||||
longValue = PyLong_AsLongAndOverflow(value, &overflow);
|
longValue = PyLong_AsLongAndOverflow(value, &overflow);
|
||||||
if (!overflow) {
|
if (!overflow) {
|
||||||
return Tcl_NewLongObj(longValue);
|
return Tcl_NewLongObj(longValue);
|
||||||
}
|
}
|
||||||
/* If there is an overflow in the long conversion,
|
/* If there is an overflow in the long conversion,
|
||||||
fall through to wideInt handling. */
|
fall through to wideInt handling. */
|
||||||
#ifdef TCL_WIDE_INT_TYPE
|
|
||||||
if (_PyLong_AsByteArray((PyLongObject *)value,
|
if (_PyLong_AsByteArray((PyLongObject *)value,
|
||||||
(unsigned char *)(void *)&wideValue,
|
(unsigned char *)(void *)&wideValue,
|
||||||
sizeof(wideValue),
|
sizeof(wideValue),
|
||||||
|
@ -929,7 +926,6 @@ AsObj(PyObject *value)
|
||||||
return Tcl_NewWideIntObj(wideValue);
|
return Tcl_NewWideIntObj(wideValue);
|
||||||
}
|
}
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
#endif
|
|
||||||
/* If there is an overflow in the wideInt conversion,
|
/* If there is an overflow in the wideInt conversion,
|
||||||
fall through to bignum handling. */
|
fall through to bignum handling. */
|
||||||
return asBignumObj(value);
|
return asBignumObj(value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue