Only __index__ should be used to make integer conversions lossless.
Other Language Changes
======================
+* Builtin and extension functions that take integer arguments no longer accept
+ :class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\ s and other
+ objects that can be converted to integers only with a loss (e.g. that have
+ the :meth:`~object.__int__` method but do not have the
+ :meth:`~object.__index__` method).
+ (Contributed by Serhiy Storchaka in :issue:`37999`.)
New Modules
unsigned char* bytes, size_t n,
int little_endian, int is_signed);
-/* _PyLong_FromNbInt: Convert the given object to a PyLongObject
- using the nb_int slot, if available. Raise TypeError if either the
- nb_int slot is not available or the result of the call to nb_int
- returns something not of type int.
-*/
-PyAPI_FUNC(PyObject *) _PyLong_FromNbInt(PyObject *);
-
-/* Convert the given object to a PyLongObject using the nb_index or
- nb_int slots, if available (the latter is deprecated).
- Raise TypeError if either nb_index and nb_int slots are not
- available or the result of the call to nb_index or nb_int
- returns something not of type int.
- Should be replaced with PyNumber_Index after the end of the
- deprecation period.
-*/
-PyAPI_FUNC(PyObject *) _PyLong_FromNbIndexOrNbInt(PyObject *);
-
/* _PyLong_Format: Convert the long to a string object with given base,
appending a base prefix of 0[box] if base is 2, 8 or 16. */
PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *obj, int base);
for t in signed_types + unsigned_types:
self.assertRaises(TypeError, t, 3.14)
self.assertRaises(TypeError, t, f)
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(t(d).value, 2)
+ self.assertRaises(TypeError, t, d)
self.assertEqual(t(i).value, 2)
def test_sizes(self):
import time as _time
import math as _math
import sys
+from operator import index as _index
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
"-timedelta(hours=24) and timedelta(hours=24)" %
(name, offset))
-def _check_int_field(value):
- if isinstance(value, int):
- return value
- if isinstance(value, float):
- raise TypeError('integer argument expected, got float')
- try:
- value = value.__index__()
- except AttributeError:
- pass
- else:
- if not isinstance(value, int):
- raise TypeError('__index__ returned non-int (type %s)' %
- type(value).__name__)
- return value
- orig = value
- try:
- value = value.__int__()
- except AttributeError:
- pass
- else:
- if not isinstance(value, int):
- raise TypeError('__int__ returned non-int (type %s)' %
- type(value).__name__)
- import warnings
- warnings.warn("an integer is required (got type %s)" %
- type(orig).__name__,
- DeprecationWarning,
- stacklevel=2)
- return value
- raise TypeError('an integer is required (got type %s)' %
- type(value).__name__)
-
def _check_date_fields(year, month, day):
- year = _check_int_field(year)
- month = _check_int_field(month)
- day = _check_int_field(day)
+ year = _index(year)
+ month = _index(month)
+ day = _index(day)
if not MINYEAR <= year <= MAXYEAR:
raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)
if not 1 <= month <= 12:
return year, month, day
def _check_time_fields(hour, minute, second, microsecond, fold):
- hour = _check_int_field(hour)
- minute = _check_int_field(minute)
- second = _check_int_field(second)
- microsecond = _check_int_field(microsecond)
+ hour = _index(hour)
+ minute = _index(minute)
+ second = _index(second)
+ microsecond = _index(microsecond)
if not 0 <= hour <= 23:
raise ValueError('hour must be in 0..23', hour)
if not 0 <= minute <= 59:
# Clean up unused names
del (_DAYNAMES, _DAYS_BEFORE_MONTH, _DAYS_IN_MONTH, _DI100Y, _DI400Y,
_DI4Y, _EPOCH, _MAXORDINAL, _MONTHNAMES, _build_struct_time,
- _check_date_fields, _check_int_field, _check_time_fields,
+ _check_date_fields, _check_time_fields,
_check_tzinfo_arg, _check_tzname, _check_utc_offset, _cmp, _cmperror,
_date_class, _days_before_month, _days_before_year, _days_in_month,
- _format_time, _format_offset, _is_leap, _isoweek1monday, _math,
+ _format_time, _format_offset, _index, _is_leap, _isoweek1monday, _math,
_ord2ymd, _time, _time_class, _tzinfo_class, _wrap_strftime, _ymd2ord,
_divide_and_round, _parse_isoformat_date, _parse_isoformat_time,
_parse_hh_mm_ss_ff, _IsoCalendarDate)
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
c = _PyLong_AsInt(args[2]);
if (c == -1 && PyErr_Occurred()) {
goto exit;
static PyObject *
test_bool_converter_impl(PyObject *module, int a, int b, int c)
-/*[clinic end generated code: output=25f20963894256a1 input=939854fa9f248c60]*/
+/*[clinic end generated code: output=b5ec6409d942e0f9 input=939854fa9f248c60]*/
/*[clinic input]
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[0]);
if (ival == -1 && PyErr_Occurred()) {
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[1]);
if (ival == -1 && PyErr_Occurred()) {
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
- long ival = PyLong_AsUnsignedLongMask(args[2]);
- if (ival == -1 && PyErr_Occurred()) {
+ unsigned long ival = PyLong_AsUnsignedLongMask(args[2]);
+ if (ival == (unsigned long)-1 && PyErr_Occurred()) {
goto exit;
}
else {
static PyObject *
test_unsigned_char_converter_impl(PyObject *module, unsigned char a,
unsigned char b, unsigned char c)
-/*[clinic end generated code: output=ebf905c5c9414762 input=021414060993e289]*/
+/*[clinic end generated code: output=c0a6ab3144481466 input=021414060993e289]*/
/*[clinic input]
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[0]);
if (ival == -1 && PyErr_Occurred()) {
static PyObject *
test_short_converter_impl(PyObject *module, short a)
-/*[clinic end generated code: output=86fe1a1496a7ff20 input=6a8a7a509a498ff4]*/
+/*[clinic end generated code: output=3ccda4bd08b6e4b4 input=6a8a7a509a498ff4]*/
/*[clinic input]
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
c = (unsigned short)PyLong_AsUnsignedLongMask(args[2]);
if (c == (unsigned short)-1 && PyErr_Occurred()) {
goto exit;
static PyObject *
test_unsigned_short_converter_impl(PyObject *module, unsigned short a,
unsigned short b, unsigned short c)
-/*[clinic end generated code: output=3779fe104319e3ae input=cdfd8eff3d9176b4]*/
+/*[clinic end generated code: output=576b5ce48424f351 input=cdfd8eff3d9176b4]*/
/*[clinic input]
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
a = _PyLong_AsInt(args[0]);
if (a == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
b = _PyLong_AsInt(args[1]);
if (b == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
d = _PyLong_AsInt(args[3]);
if (d == -1 && PyErr_Occurred()) {
goto exit;
static PyObject *
test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d)
-/*[clinic end generated code: output=10a2e48a34af5d7a input=d20541fc1ca0553e]*/
+/*[clinic end generated code: output=8a1a7b02ebe9eeac input=d20541fc1ca0553e]*/
/*[clinic input]
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
c = (unsigned int)PyLong_AsUnsignedLongMask(args[2]);
if (c == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
static PyObject *
test_unsigned_int_converter_impl(PyObject *module, unsigned int a,
unsigned int b, unsigned int c)
-/*[clinic end generated code: output=189176ce67c7d2e7 input=5533534828b62fc0]*/
+/*[clinic end generated code: output=4f53904bfa1a0250 input=5533534828b62fc0]*/
/*[clinic input]
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
a = PyLong_AsLong(args[0]);
if (a == -1 && PyErr_Occurred()) {
goto exit;
static PyObject *
test_long_converter_impl(PyObject *module, long a)
-/*[clinic end generated code: output=44cd8823f59d116b input=d2179e3c9cdcde89]*/
+/*[clinic end generated code: output=e5e7883fddcf4218 input=d2179e3c9cdcde89]*/
/*[clinic input]
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
a = PyLong_AsLongLong(args[0]);
if (a == -1 && PyErr_Occurred()) {
goto exit;
static PyObject *
test_long_long_converter_impl(PyObject *module, long long a)
-/*[clinic end generated code: output=7143b585d7e433e8 input=d5fc81577ff4dd02]*/
+/*[clinic end generated code: output=0488ac9e8c1d77bb input=d5fc81577ff4dd02]*/
/*[clinic input]
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
static PyObject *
test_Py_ssize_t_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
Py_ssize_t c)
-/*[clinic end generated code: output=a46d2aaf40c10398 input=3855f184bb3f299d]*/
+/*[clinic end generated code: output=ea781bb7169b3436 input=3855f184bb3f299d]*/
/*[clinic input]
def __int__(self):
return self.value
- for xx in [decimal.Decimal(10),
- decimal.Decimal('10.9'),
- Number(10)]:
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(datetime(10, 10, 10, 10, 10, 10, 10),
- datetime(xx, xx, xx, xx, xx, xx, xx))
-
- with self.assertRaisesRegex(TypeError, '^an integer is required '
- r'\(got type str\)$'):
- datetime(10, 10, '10')
-
- f10 = Number(10.9)
- with self.assertRaisesRegex(TypeError, '^__int__ returned non-int '
- r'\(type float\)$'):
- datetime(10, 10, f10)
-
class Float(float):
pass
- s10 = Float(10.9)
- with self.assertRaisesRegex(TypeError, '^integer argument expected, '
- 'got float$'):
- datetime(10, 10, s10)
- with self.assertRaises(TypeError):
- datetime(10., 10, 10)
- with self.assertRaises(TypeError):
- datetime(10, 10., 10)
- with self.assertRaises(TypeError):
- datetime(10, 10, 10.)
- with self.assertRaises(TypeError):
- datetime(10, 10, 10, 10.)
- with self.assertRaises(TypeError):
- datetime(10, 10, 10, 10, 10.)
- with self.assertRaises(TypeError):
- datetime(10, 10, 10, 10, 10, 10.)
- with self.assertRaises(TypeError):
- datetime(10, 10, 10, 10, 10, 10, 10.)
+ for xx in [10.0, Float(10.9),
+ decimal.Decimal(10), decimal.Decimal('10.9'),
+ Number(10), Number(10.9),
+ '10']:
+ self.assertRaises(TypeError, datetime, xx, 10, 10, 10, 10, 10, 10)
+ self.assertRaises(TypeError, datetime, 10, xx, 10, 10, 10, 10, 10)
+ self.assertRaises(TypeError, datetime, 10, 10, xx, 10, 10, 10, 10)
+ self.assertRaises(TypeError, datetime, 10, 10, 10, xx, 10, 10, 10)
+ self.assertRaises(TypeError, datetime, 10, 10, 10, 10, xx, 10, 10)
+ self.assertRaises(TypeError, datetime, 10, 10, 10, 10, 10, xx, 10)
+ self.assertRaises(TypeError, datetime, 10, 10, 10, 10, 10, 10, xx)
+
#############################################################################
# Local Time Disambiguation
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_b(BadIndex2()))
self.assertEqual(0, getargs_b(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_b(Int()))
+ self.assertRaises(TypeError, getargs_b, Int())
self.assertEqual(0, getargs_b(IntSubclass()))
self.assertRaises(TypeError, getargs_b, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_b(BadInt2()))
+ self.assertRaises(TypeError, getargs_b, BadInt2())
self.assertEqual(0, getargs_b(BadInt3()))
self.assertRaises(OverflowError, getargs_b, -1)
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_B(BadIndex2()))
self.assertEqual(0, getargs_B(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_B(Int()))
+ self.assertRaises(TypeError, getargs_B, Int())
self.assertEqual(0, getargs_B(IntSubclass()))
self.assertRaises(TypeError, getargs_B, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_B(BadInt2()))
+ self.assertRaises(TypeError, getargs_B, BadInt2())
self.assertEqual(0, getargs_B(BadInt3()))
self.assertEqual(UCHAR_MAX, getargs_B(-1))
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_H(BadIndex2()))
self.assertEqual(0, getargs_H(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_H(Int()))
+ self.assertRaises(TypeError, getargs_H, Int())
self.assertEqual(0, getargs_H(IntSubclass()))
self.assertRaises(TypeError, getargs_H, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_H(BadInt2()))
+ self.assertRaises(TypeError, getargs_H, BadInt2())
self.assertEqual(0, getargs_H(BadInt3()))
self.assertEqual(USHRT_MAX, getargs_H(-1))
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_I(BadIndex2()))
self.assertEqual(0, getargs_I(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_I(Int()))
+ self.assertRaises(TypeError, getargs_I, Int())
self.assertEqual(0, getargs_I(IntSubclass()))
self.assertRaises(TypeError, getargs_I, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_I(BadInt2()))
+ self.assertRaises(TypeError, getargs_I, BadInt2())
self.assertEqual(0, getargs_I(BadInt3()))
self.assertEqual(UINT_MAX, getargs_I(-1))
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_h(BadIndex2()))
self.assertEqual(0, getargs_h(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_h(Int()))
+ self.assertRaises(TypeError, getargs_h, Int())
self.assertEqual(0, getargs_h(IntSubclass()))
self.assertRaises(TypeError, getargs_h, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_h(BadInt2()))
+ self.assertRaises(TypeError, getargs_h, BadInt2())
self.assertEqual(0, getargs_h(BadInt3()))
self.assertRaises(OverflowError, getargs_h, SHRT_MIN-1)
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_i(BadIndex2()))
self.assertEqual(0, getargs_i(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_i(Int()))
+ self.assertRaises(TypeError, getargs_i, Int())
self.assertEqual(0, getargs_i(IntSubclass()))
self.assertRaises(TypeError, getargs_i, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_i(BadInt2()))
+ self.assertRaises(TypeError, getargs_i, BadInt2())
self.assertEqual(0, getargs_i(BadInt3()))
self.assertRaises(OverflowError, getargs_i, INT_MIN-1)
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_l(BadIndex2()))
self.assertEqual(0, getargs_l(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_l(Int()))
+ self.assertRaises(TypeError, getargs_l, Int())
self.assertEqual(0, getargs_l(IntSubclass()))
self.assertRaises(TypeError, getargs_l, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_l(BadInt2()))
+ self.assertRaises(TypeError, getargs_l, BadInt2())
self.assertEqual(0, getargs_l(BadInt3()))
self.assertRaises(OverflowError, getargs_l, LONG_MIN-1)
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_L(BadIndex2()))
self.assertEqual(0, getargs_L(BadIndex3()))
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(99, getargs_L(Int()))
+ self.assertRaises(TypeError, getargs_L, Int())
self.assertEqual(0, getargs_L(IntSubclass()))
self.assertRaises(TypeError, getargs_L, BadInt())
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(1, getargs_L(BadInt2()))
+ self.assertRaises(TypeError, getargs_L, BadInt2())
self.assertEqual(0, getargs_L(BadInt3()))
self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)
self.skipTest('no groups')
# Choose an existent gid.
gid = entries[0][2]
- self.assertWarns(DeprecationWarning, grp.getgrgid, float(gid))
- self.assertWarns(DeprecationWarning, grp.getgrgid, str(gid))
+ self.assertRaises(TypeError, grp.getgrgid, float(gid))
+ self.assertRaises(TypeError, grp.getgrgid, str(gid))
if __name__ == "__main__":
self.assertIs(type(n), int)
bad_int = TruncReturnsBadInt()
- with self.assertWarns(DeprecationWarning):
- n = int(bad_int)
- self.assertEqual(n, 1)
- self.assertIs(type(n), int)
+ self.assertRaises(TypeError, int, bad_int)
good_int = TruncReturnsIntSubclass()
n = int(good_int)
self.assertRaises(ValueError, math.factorial, -10**100)
def testFactorialNonIntegers(self):
- with self.assertWarns(DeprecationWarning):
- self.assertEqual(math.factorial(5.0), 120)
- with self.assertWarns(DeprecationWarning):
- self.assertRaises(ValueError, math.factorial, 5.2)
- with self.assertWarns(DeprecationWarning):
- self.assertRaises(ValueError, math.factorial, -1.0)
- with self.assertWarns(DeprecationWarning):
- self.assertRaises(ValueError, math.factorial, -1e100)
+ self.assertRaises(TypeError, math.factorial, 5.0)
+ self.assertRaises(TypeError, math.factorial, 5.2)
+ self.assertRaises(TypeError, math.factorial, -1.0)
+ self.assertRaises(TypeError, math.factorial, -1e100)
self.assertRaises(TypeError, math.factorial, decimal.Decimal('5'))
self.assertRaises(TypeError, math.factorial, decimal.Decimal('5.2'))
self.assertRaises(TypeError, math.factorial, "5")
# Currently raises OverflowError for inputs that are too large
# to fit into a C long.
self.assertRaises(OverflowError, math.factorial, 10**100)
- with self.assertWarns(DeprecationWarning):
- self.assertRaises(OverflowError, math.factorial, 1e100)
+ self.assertRaises(TypeError, math.factorial, 1e100)
def testFloor(self):
self.assertRaises(TypeError, math.floor)
self.assertIn('not NoneType', str(cm.exception))
with self.assertRaises(TypeError) as cm:
s.sendto(b'foo', 'bar', sockname)
- self.assertIn('an integer is required', str(cm.exception))
with self.assertRaises(TypeError) as cm:
s.sendto(b'foo', None, None)
- self.assertIn('an integer is required', str(cm.exception))
# wrong number of args
with self.assertRaises(TypeError) as cm:
s.sendto(b'foo')
socket.SOCK_STREAM)
def test_socket_fileno_rejects_float(self):
- with self.assertRaisesRegex(TypeError, "integer argument expected"):
+ with self.assertRaises(TypeError):
socket.socket(socket.AF_INET, socket.SOCK_STREAM, fileno=42.5)
def test_socket_fileno_rejects_other_types(self):
- with self.assertRaisesRegex(TypeError, "integer is required"):
+ with self.assertRaises(TypeError):
socket.socket(socket.AF_INET, socket.SOCK_STREAM, fileno="foo")
def test_socket_fileno_rejects_invalid_socket(self):
--- /dev/null
+Builtin and extension functions that take integer arguments no longer accept
+:class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\ s and other
+objects that can be converted to integers only with a loss (e.g. that have
+the :meth:`~object.__int__` method but do not have the
+:meth:`~object.__index__` method).
goto skip_optional_kwonly;
}
if (fastargs[1]) {
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
digest_size = _PyLong_AsInt(fastargs[1]);
if (digest_size == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[5]) {
- if (PyFloat_Check(fastargs[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fanout = _PyLong_AsInt(fastargs[5]);
if (fanout == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[6]) {
- if (PyFloat_Check(fastargs[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
depth = _PyLong_AsInt(fastargs[6]);
if (depth == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[9]) {
- if (PyFloat_Check(fastargs[9])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
node_depth = _PyLong_AsInt(fastargs[9]);
if (node_depth == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[10]) {
- if (PyFloat_Check(fastargs[10])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
inner_size = _PyLong_AsInt(fastargs[10]);
if (inner_size == -1 && PyErr_Occurred()) {
goto exit;
{
return _blake2_blake2b_hexdigest_impl(self);
}
-/*[clinic end generated code: output=2d6d0fe9aa42a42a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=10eb47aba77f192d input=a9049054013a1b77]*/
goto skip_optional_kwonly;
}
if (fastargs[1]) {
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
digest_size = _PyLong_AsInt(fastargs[1]);
if (digest_size == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[5]) {
- if (PyFloat_Check(fastargs[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fanout = _PyLong_AsInt(fastargs[5]);
if (fanout == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[6]) {
- if (PyFloat_Check(fastargs[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
depth = _PyLong_AsInt(fastargs[6]);
if (depth == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[9]) {
- if (PyFloat_Check(fastargs[9])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
node_depth = _PyLong_AsInt(fastargs[9]);
if (node_depth == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[10]) {
- if (PyFloat_Check(fastargs[10])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
inner_size = _PyLong_AsInt(fastargs[10]);
if (inner_size == -1 && PyErr_Occurred()) {
goto exit;
{
return _blake2_blake2s_hexdigest_impl(self);
}
-/*[clinic end generated code: output=c80d8d06ce40a192 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f7ee8092ed67e9c7 input=a9049054013a1b77]*/
static int
get_long(PyObject *v, long *p)
{
- long x;
-
- if (PyFloat_Check(v)) {
- PyErr_SetString(PyExc_TypeError,
- "int expected instead of float");
- return -1;
- }
- x = PyLong_AsUnsignedLongMask(v);
+ long x = PyLong_AsUnsignedLongMask(v);
if (x == -1 && PyErr_Occurred())
return -1;
*p = x;
static int
get_ulong(PyObject *v, unsigned long *p)
{
- unsigned long x;
-
- if (PyFloat_Check(v)) {
- PyErr_SetString(PyExc_TypeError,
- "int expected instead of float");
- return -1;
- }
- x = PyLong_AsUnsignedLongMask(v);
+ unsigned long x = PyLong_AsUnsignedLongMask(v);
if (x == (unsigned long)-1 && PyErr_Occurred())
return -1;
*p = x;
static int
get_longlong(PyObject *v, long long *p)
{
- long long x;
- if (PyFloat_Check(v)) {
- PyErr_SetString(PyExc_TypeError,
- "int expected instead of float");
- return -1;
- }
- x = PyLong_AsUnsignedLongLongMask(v);
+ long long x = PyLong_AsUnsignedLongLongMask(v);
if (x == -1 && PyErr_Occurred())
return -1;
*p = x;
static int
get_ulonglong(PyObject *v, unsigned long long *p)
{
- unsigned long long x;
- if (PyFloat_Check(v)) {
- PyErr_SetString(PyExc_TypeError,
- "int expected instead of float");
- return -1;
- }
- x = PyLong_AsUnsignedLongLongMask(v);
+ unsigned long long x = PyLong_AsUnsignedLongLongMask(v);
if (x == (unsigned long long)-1 && PyErr_Occurred())
return -1;
*p = x;
}
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
buffering = _PyLong_AsInt(args[2]);
if (buffering == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[6]) {
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
closefd = _PyLong_AsInt(args[6]);
if (closefd == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=3df6bc6d91697545 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c0dd7a262c30ebc input=a9049054013a1b77]*/
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
whence = _PyLong_AsInt(args[1]);
if (whence == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(fastargs[1]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(fastargs[1]);
if (PyTuple_GET_SIZE(args) < 3) {
goto skip_optional;
}
- if (PyFloat_Check(PyTuple_GET_ITEM(args, 2))) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(PyTuple_GET_ITEM(args, 2));
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(fastargs[1]);
exit:
return return_value;
}
-/*[clinic end generated code: output=7d9ad40c95bdd808 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1882bb497ddc9375 input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
whence = _PyLong_AsInt(args[1]);
if (whence == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=4ec2506def9c8eb9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ba0f302f16397741 input=a9049054013a1b77]*/
}
}
if (fastargs[2]) {
- if (PyFloat_Check(fastargs[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
closefd = _PyLong_AsInt(fastargs[2]);
if (closefd == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
whence = _PyLong_AsInt(args[1]);
if (whence == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
#define _IO_FILEIO_TRUNCATE_METHODDEF
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
-/*[clinic end generated code: output=e7682d0a3264d284 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3479912ec0f7e029 input=a9049054013a1b77]*/
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
{
return _io__RawIOBase_readall_impl(self);
}
-/*[clinic end generated code: output=61b6ea7153ef9940 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1f9ce590549593be input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
whence = _PyLong_AsInt(args[1]);
if (whence == -1 && PyErr_Occurred()) {
goto exit;
{
return _io_StringIO_seekable_impl(self);
}
-/*[clinic end generated code: output=7aad5ab2e64a25b8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9c428b2942d54991 input=a9049054013a1b77]*/
goto exit;
}
decoder = fastargs[0];
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
translate = _PyLong_AsInt(fastargs[1]);
if (translate == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[1]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (fastargs[4]) {
- if (PyFloat_Check(fastargs[4])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
line_buffering = _PyLong_AsInt(fastargs[4]);
if (line_buffering == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(fastargs[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
write_through = _PyLong_AsInt(fastargs[5]);
if (write_through == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
whence = _PyLong_AsInt(args[1]);
if (whence == -1 && PyErr_Occurred()) {
goto exit;
{
return _io_TextIOWrapper_close_impl(self);
}
-/*[clinic end generated code: output=b1bae4f4cdf6019e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ea96ee1eb3a71f77 input=a9049054013a1b77]*/
}
}
if (fastargs[2]) {
- if (PyFloat_Check(fastargs[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
closefd = _PyLong_AsInt(fastargs[2]);
if (closefd == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
-/*[clinic end generated code: output=f5b8860a658a001a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a28b3120fa53b256 input=a9049054013a1b77]*/
self->fd = -1;
}
- if (PyFloat_Check(nameobj)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float");
- return -1;
- }
-
fd = _PyLong_AsInt(nameobj);
if (fd < 0) {
if (!PyErr_Occurred()) {
pos = 0;
}
else {
- if(PyFloat_Check(posobj)) {
- PyErr_SetString(PyExc_TypeError, "an integer is required");
- return NULL;
- }
#if defined(HAVE_LARGEFILE_SUPPORT)
pos = PyLong_AsLongLong(posobj);
#else
self->handle = INVALID_HANDLE_VALUE;
}
- if (PyFloat_Check(nameobj)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float");
- return -1;
- }
-
fd = _PyLong_AsInt(nameobj);
if (fd < 0) {
if (!PyErr_Occurred()) {
goto exit;
}
path = args[0];
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[1]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[2]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF
#define _POSIXSHMEM_SHM_UNLINK_METHODDEF
#endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */
-/*[clinic end generated code: output=9132861c61d8c2d8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bca8e78d0f43ef1a input=a9049054013a1b77]*/
(unsigned long) ((unsigned int *)ap->ob_item)[i]);
}
-static PyObject *
-get_int_unless_float(PyObject *v)
-{
- if (PyFloat_Check(v)) {
- PyErr_SetString(PyExc_TypeError,
- "array item must be integer");
- return NULL;
- }
- return _PyLong_FromNbIndexOrNbInt(v);
-}
-
static int
II_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
{
int do_decref = 0; /* if nb_int was called */
if (!PyLong_Check(v)) {
- v = get_int_unless_float(v);
+ v = PyNumber_Index(v);
if (NULL == v) {
return -1;
}
int do_decref = 0; /* if nb_int was called */
if (!PyLong_Check(v)) {
- v = get_int_unless_float(v);
+ v = PyNumber_Index(v);
if (NULL == v) {
return -1;
}
int do_decref = 0; /* if nb_int was called */
if (!PyLong_Check(v)) {
- v = get_int_unless_float(v);
+ v = PyNumber_Index(v);
if (NULL == v) {
return -1;
}
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[1]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[1]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=5ce6fd4ca1f95620 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c0f74129db07c87 input=a9049054013a1b77]*/
goto skip_optional_pos;
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
exit:
return return_value;
}
-/*[clinic end generated code: output=bcbd6c77331a08f0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e9097a9acd10b13f input=a9049054013a1b77]*/
if (PyTuple_GET_SIZE(args) < 1) {
goto skip_optional;
}
- if (PyFloat_Check(PyTuple_GET_ITEM(args, 0))) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
compresslevel = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0));
if (compresslevel == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
exit:
return return_value;
}
-/*[clinic end generated code: output=3f3f1e788fe28ee1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c69a7de8e26c2ad1 input=a9049054013a1b77]*/
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
byteorder = _PyLong_AsInt(args[2]);
if (byteorder == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[3]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
byteorder = _PyLong_AsInt(args[2]);
if (byteorder == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[3]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[2]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("code_page_decode", nargs, 2, 4)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
codepage = _PyLong_AsInt(args[0]);
if (codepage == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
final = _PyLong_AsInt(args[3]);
if (final == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
byteorder = _PyLong_AsInt(args[2]);
if (byteorder == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
byteorder = _PyLong_AsInt(args[2]);
if (byteorder == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("code_page_encode", nargs, 2, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
code_page = _PyLong_AsInt(args[0]);
if (code_page == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF
#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
-/*[clinic end generated code: output=51b42d170889524c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=eeead01414be6e42 input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("_tuplegetter", PyTuple_GET_SIZE(args), 2, 2)) {
goto exit;
}
- if (PyFloat_Check(PyTuple_GET_ITEM(args, 0))) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(PyTuple_GET_ITEM(args, 0));
exit:
return return_value;
}
-/*[clinic end generated code: output=9d2bfcc9df5faf35 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=439d77631a056b4d input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("move", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
y = _PyLong_AsInt(args[0]);
if (y == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
x = _PyLong_AsInt(args[1]);
if (x == -1 && PyErr_Occurred()) {
goto exit;
{
return _curses_panel_update_panels_impl(module);
}
-/*[clinic end generated code: output=d96dc1fd68e898d9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1226d5f94361ebfb input=a9049054013a1b77]*/
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
attr = PyLong_AsLong(args[1]);
if (attr == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
long attr;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
attr = PyLong_AsLong(arg);
if (attr == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
long attr;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
attr = PyLong_AsLong(arg);
if (attr == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
long attr;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
attr = PyLong_AsLong(arg);
if (attr == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
attr = PyLong_AsLong(args[1]);
if (attr == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
attr = PyLong_AsLong(args[1]);
if (attr == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("enclose", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
y = _PyLong_AsInt(args[0]);
if (y == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
x = _PyLong_AsInt(args[1]);
if (x == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int line;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
line = _PyLong_AsInt(arg);
if (line == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("redrawln", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
beg = _PyLong_AsInt(args[0]);
if (beg == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
num = _PyLong_AsInt(args[1]);
if (num == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("setscrreg", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
top = _PyLong_AsInt(args[0]);
if (top == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
bottom = _PyLong_AsInt(args[1]);
if (bottom == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(args[0]);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
short color_number;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred()) {
PyObject *return_value = NULL;
short color_number;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred()) {
PyObject *return_value = NULL;
int visibility;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
visibility = _PyLong_AsInt(arg);
if (visibility == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int ms;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
ms = _PyLong_AsInt(arg);
if (ms == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(args[0]);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("ungetmouse", nargs, 5, 5)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[0]);
if (ival == -1 && PyErr_Occurred()) {
id = (short) ival;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
x = _PyLong_AsInt(args[1]);
if (x == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
y = _PyLong_AsInt(args[2]);
if (y == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
z = _PyLong_AsInt(args[3]);
if (z == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
unsigned char tenths;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred()) {
PyObject *return_value = NULL;
int key;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
key = _PyLong_AsInt(arg);
if (key == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("init_color", nargs, 4, 4)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[0]);
if (ival == -1 && PyErr_Occurred()) {
color_number = (short) ival;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[1]);
if (ival == -1 && PyErr_Occurred()) {
r = (short) ival;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[2]);
if (ival == -1 && PyErr_Occurred()) {
g = (short) ival;
}
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[3]);
if (ival == -1 && PyErr_Occurred()) {
if (!_PyArg_CheckPositional("init_pair", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[0]);
if (ival == -1 && PyErr_Occurred()) {
pair_number = (short) ival;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[1]);
if (ival == -1 && PyErr_Occurred()) {
fg = (short) ival;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(args[2]);
if (ival == -1 && PyErr_Occurred()) {
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[1]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int ms;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
ms = _PyLong_AsInt(arg);
if (ms == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int size;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
size = _PyLong_AsInt(arg);
if (size == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int flag;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(arg);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("is_term_resized", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nlines = _PyLong_AsInt(args[0]);
if (nlines == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
ncols = _PyLong_AsInt(args[1]);
if (ncols == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int key;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
key = _PyLong_AsInt(arg);
if (key == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int yes;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
yes = _PyLong_AsInt(arg);
if (yes == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int interval;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
interval = _PyLong_AsInt(arg);
if (interval == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int ms;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
ms = _PyLong_AsInt(arg);
if (ms == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("newpad", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nlines = _PyLong_AsInt(args[0]);
if (nlines == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
ncols = _PyLong_AsInt(args[1]);
if (ncols == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(args[0]);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
short pair_number;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred()) {
PyObject *return_value = NULL;
int attr;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
attr = _PyLong_AsInt(arg);
if (attr == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(args[0]);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(args[0]);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("resizeterm", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nlines = _PyLong_AsInt(args[0]);
if (nlines == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
ncols = _PyLong_AsInt(args[1]);
if (ncols == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("resize_term", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nlines = _PyLong_AsInt(args[0]);
if (nlines == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
ncols = _PyLong_AsInt(args[1]);
if (ncols == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("setsyx", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
y = _PyLong_AsInt(args[0]);
if (y == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
x = _PyLong_AsInt(args[1]);
if (x == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int fd;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int flag;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(arg);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF
#define _CURSES_USE_DEFAULT_COLORS_METHODDEF
#endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */
-/*[clinic end generated code: output=b53652f8acafd817 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=478d93f7692385eb input=a9049054013a1b77]*/
if (!fastargs) {
goto exit;
}
- if (PyFloat_Check(fastargs[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
year = _PyLong_AsInt(fastargs[0]);
if (year == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
week = _PyLong_AsInt(fastargs[1]);
if (week == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(fastargs[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
weekday = _PyLong_AsInt(fastargs[2]);
if (weekday == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=5e17549f29a439a5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f61310936e3d8091 input=a9049054013a1b77]*/
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[2]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=7ced103488cbca7a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ba4ff07b8c8bbfe4 input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
exit:
return return_value;
}
-/*[clinic end generated code: output=b7f6a32462fc42a9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c98b210c525a9338 input=a9049054013a1b77]*/
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[2]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=2766471b2fa1a816 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c9d43f42677f4efb input=a9049054013a1b77]*/
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
_PyArg_BadArgument("pbkdf2_hmac", "argument 'salt'", "contiguous buffer", args[2]);
goto exit;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
iterations = PyLong_AsLong(args[3]);
if (iterations == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[5]) {
- if (PyFloat_Check(args[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
maxmem = PyLong_AsLong(args[5]);
if (maxmem == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_kwonly;
}
}
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
dklen = PyLong_AsLong(args[6]);
if (dklen == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _HASHLIB_GET_FIPS_MODE_METHODDEF
#define _HASHLIB_GET_FIPS_MODE_METHODDEF
#endif /* !defined(_HASHLIB_GET_FIPS_MODE_METHODDEF) */
-/*[clinic end generated code: output=a0bff5dcef88de6a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d8dddcd85fb11dde input=a9049054013a1b77]*/
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
if (fastargs[0]) {
- if (PyFloat_Check(fastargs[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
format = _PyLong_AsInt(fastargs[0]);
if (format == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int check_id;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
check_id = _PyLong_AsInt(arg);
if (check_id == -1 && PyErr_Occurred()) {
goto exit;
return return_value;
}
-/*[clinic end generated code: output=f7477a10e86a717d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a87074ca902bd432 input=a9049054013a1b77]*/
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
opcode = _PyLong_AsInt(args[0]);
if (opcode == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=7bc08f2835b2cf89 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bcf66d25c2624197 input=a9049054013a1b77]*/
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
exit:
return return_value;
}
-/*[clinic end generated code: output=e7ed71a8c475a901 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1fe4adf4f5761420 input=a9049054013a1b77]*/
PyObject *return_value = NULL;
int k;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
k = _PyLong_AsInt(arg);
if (k == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=a7feb0c9c8d1b627 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=cc8a23b2757dc6ba input=a9049054013a1b77]*/
int character;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
character = _PyLong_AsInt(arg);
if (character == -1 && PyErr_Occurred()) {
goto exit;
int character;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
character = _PyLong_AsInt(arg);
if (character == -1 && PyErr_Occurred()) {
goto exit;
int character;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
character = _PyLong_AsInt(arg);
if (character == -1 && PyErr_Occurred()) {
goto exit;
int character;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
character = _PyLong_AsInt(arg);
if (character == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto exit;
}
pattern = args[0];
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[1]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
goto exit;
}
code = args[2];
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[3]);
{
return _sre_SRE_Scanner_search_impl(self);
}
-/*[clinic end generated code: output=1adeddce58ae284c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7a3360917b40a808 input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("_SSLContext", PyTuple_GET_SIZE(args), 1, 1)) {
goto exit;
}
- if (PyFloat_Check(PyTuple_GET_ITEM(args, 0))) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
proto_version = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0));
if (proto_version == -1 && PyErr_Occurred()) {
goto exit;
goto exit;
}
sock = args[0];
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
server_side = _PyLong_AsInt(args[1]);
if (server_side == -1 && PyErr_Occurred()) {
goto exit;
goto exit;
}
outgoing = (PySSLMemoryBIO *)args[1];
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
server_side = _PyLong_AsInt(args[2]);
if (server_side == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
len = _PyLong_AsInt(args[0]);
if (len == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int n;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
n = _PyLong_AsInt(arg);
if (n == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int n;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
n = _PyLong_AsInt(arg);
if (n == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int nid;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nid = _PyLong_AsInt(arg);
if (nid == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _SSL_ENUM_CRLS_METHODDEF
#define _SSL_ENUM_CRLS_METHODDEF
#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
-/*[clinic end generated code: output=a4aeb3f92a091c64 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d4e4f9cdd08819f4 input=a9049054013a1b77]*/
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
return return_value;
}
-/*[clinic end generated code: output=6a6228cfc4b7099c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1205daf7f616f0cf input=a9049054013a1b77]*/
goto exit;
}
file = args[0];
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mask = _PyLong_AsInt(args[1]);
if (mask == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("createtimerhandler", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
milliseconds = _PyLong_AsInt(args[0]);
if (milliseconds == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
threshold = _PyLong_AsInt(args[0]);
if (threshold == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[0]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
interactive = _PyLong_AsInt(args[3]);
if (interactive == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 5) {
goto skip_optional;
}
- if (PyFloat_Check(args[4])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
wantobjects = _PyLong_AsInt(args[4]);
if (wantobjects == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 6) {
goto skip_optional;
}
- if (PyFloat_Check(args[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
wantTk = _PyLong_AsInt(args[5]);
if (wantTk == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 7) {
goto skip_optional;
}
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
sync = _PyLong_AsInt(args[6]);
if (sync == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int new_val;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
new_val = _PyLong_AsInt(arg);
if (new_val == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
-/*[clinic end generated code: output=492b8b833fe54bc9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ab311480dd044fe4 input=a9049054013a1b77]*/
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nframe = _PyLong_AsInt(args[0]);
if (nframe == -1 && PyErr_Occurred()) {
goto exit;
{
return _tracemalloc_reset_peak_impl(module);
}
-/*[clinic end generated code: output=a130117b1af821da input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bafca0a19b0b0823 input=a9049054013a1b77]*/
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
goto exit;
}
f = args[0];
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto exit;
}
typecode = PyUnicode_READ_CHAR(args[1], 0);
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mformat_code = _PyLong_AsInt(args[2]);
if (mformat_code == -1 && PyErr_Occurred()) {
goto exit;
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
-/*[clinic end generated code: output=9f70748dd3bc532f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c953eb8486c7c8da input=a9049054013a1b77]*/
_PyArg_BadArgument("getsample", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
_PyArg_BadArgument("max", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("minmax", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("avg", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("rms", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("findmax", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
_PyArg_BadArgument("avgpp", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("maxpp", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("cross", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("mul", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("tomono", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("tostereo", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("add", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[2]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("bias", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
bias = _PyLong_AsInt(args[2]);
if (bias == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("reverse", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("byteswap", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("lin2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
newwidth = _PyLong_AsInt(args[2]);
if (newwidth == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("ratecv", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nchannels = _PyLong_AsInt(args[2]);
if (nchannels == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
inrate = _PyLong_AsInt(args[3]);
if (inrate == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[4])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
outrate = _PyLong_AsInt(args[4]);
if (outrate == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 7) {
goto skip_optional;
}
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
weightA = _PyLong_AsInt(args[6]);
if (weightA == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 8) {
goto skip_optional;
}
- if (PyFloat_Check(args[7])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
weightB = _PyLong_AsInt(args[7]);
if (weightB == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("lin2ulaw", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("ulaw2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("lin2alaw", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("alaw2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("lin2adpcm", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("adpcm2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
width = _PyLong_AsInt(args[1]);
if (width == -1 && PyErr_Occurred()) {
goto exit;
return return_value;
}
-/*[clinic end generated code: output=6b4f2c597f295abc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=343e5ae478fc0359 input=a9049054013a1b77]*/
if (!noptargs) {
goto skip_optional_kwonly;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
backtick = _PyLong_AsInt(args[1]);
if (backtick == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_kwonly;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
newline = _PyLong_AsInt(args[1]);
if (newline == -1 && PyErr_Occurred()) {
goto exit;
_PyArg_BadArgument("crc_hqx", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
crc = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (crc == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
crc = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (crc == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
bytes_per_sep = _PyLong_AsInt(args[2]);
if (bytes_per_sep == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
bytes_per_sep = _PyLong_AsInt(args[2]);
if (bytes_per_sep == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
header = _PyLong_AsInt(args[1]);
if (header == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
quotetabs = _PyLong_AsInt(args[1]);
if (quotetabs == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
istext = _PyLong_AsInt(args[2]);
if (istext == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
header = _PyLong_AsInt(args[3]);
if (header == -1 && PyErr_Occurred()) {
goto exit;
return return_value;
}
-/*[clinic end generated code: output=a1e878d3963b615e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=95a0178f30801b89 input=a9049054013a1b77]*/
if (!conv_descriptor(args[0], &fd)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
code = _PyLong_AsInt(args[1]);
if (code == -1 && PyErr_Occurred()) {
goto exit;
if (!conv_descriptor(args[0], &fd)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
code = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (code == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
if (!conv_descriptor(args[0], &fd)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
code = _PyLong_AsInt(args[1]);
if (code == -1 && PyErr_Occurred()) {
goto exit;
if (!conv_descriptor(args[0], &fd)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
code = _PyLong_AsInt(args[1]);
if (code == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 5) {
goto skip_optional;
}
- if (PyFloat_Check(args[4])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
whence = _PyLong_AsInt(args[4]);
if (whence == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=e912d25e28362c52 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=91c2295402509595 input=a9049054013a1b77]*/
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
generation = _PyLong_AsInt(args[0]);
if (generation == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int flags;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(arg);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=bd6a8056989e2e69 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=61e15f3a549f3ab5 input=a9049054013a1b77]*/
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto exit;
}
iterable = fastargs[0];
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(fastargs[1]);
goto exit;
}
iterable = fastargs[0];
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(fastargs[1]);
exit:
return return_value;
}
-/*[clinic end generated code: output=392c9706e79f6710 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=07211f86c4153050 input=a9049054013a1b77]*/
if (!path_converter(args[0], &path)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int fd;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!path_converter(args[0], &path)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (!path_converter(args[0], &path)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int increment;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
increment = _PyLong_AsInt(arg);
if (increment == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
which = _PyLong_AsInt(args[0]);
if (which == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
who = _PyLong_AsInt(args[1]);
if (who == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
which = _PyLong_AsInt(args[0]);
if (which == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
who = _PyLong_AsInt(args[1]);
if (who == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
priority = _PyLong_AsInt(args[2]);
if (priority == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int mask;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mask = _PyLong_AsInt(arg);
if (mask == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[5]) {
- if (PyFloat_Check(args[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
resetids = _PyLong_AsInt(args[5]);
if (resetids == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[6]) {
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
setsid = _PyLong_AsInt(args[6]);
if (setsid == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[5]) {
- if (PyFloat_Check(args[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
resetids = _PyLong_AsInt(args[5]);
if (resetids == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[6]) {
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
setsid = _PyLong_AsInt(args[6]);
if (setsid == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("spawnv", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[0]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("spawnve", nargs, 4, 4)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[0]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
policy = _PyLong_AsInt(args[0]);
if (policy == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
policy = _PyLong_AsInt(args[0]);
if (policy == -1 && PyErr_Occurred()) {
goto exit;
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
basegid = _PyLong_AsInt(args[1]);
if (basegid == -1 && PyErr_Occurred()) {
goto exit;
if (!PyUnicode_FSConverter(args[0], &oname)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
gid = _PyLong_AsInt(args[1]);
if (gid == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int op;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
op = _PyLong_AsInt(arg);
if (op == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
options = _PyLong_AsInt(args[0]);
if (options == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int fd;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!path_converter(args[0], &path)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[1]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[2]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("closerange", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd_low = _PyLong_AsInt(args[0]);
if (fd_low == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd_high = _PyLong_AsInt(args[1]);
if (fd_high == -1 && PyErr_Occurred()) {
goto exit;
int fd;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd2 = _PyLong_AsInt(args[1]);
if (fd2 == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("lockf", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
command = _PyLong_AsInt(args[1]);
if (command == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("lseek", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!Py_off_t_converter(args[1], &position)) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
how = _PyLong_AsInt(args[2]);
if (how == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("read", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
if (!_PyArg_CheckPositional("readv", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("pread", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
if (!_PyArg_CheckPositional("preadv", nargs, 3, 4)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[3]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("write", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
out_fd = _PyLong_AsInt(args[0]);
if (out_fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
in_fd = _PyLong_AsInt(args[1]);
if (in_fd == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[6]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
out_fd = _PyLong_AsInt(args[0]);
if (out_fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
in_fd = _PyLong_AsInt(args[1]);
if (in_fd == -1 && PyErr_Occurred()) {
goto exit;
if (!Py_off_t_converter(args[2], &offset)) {
goto exit;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[3]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[6]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
out_fd = _PyLong_AsInt(args[0]);
if (out_fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
in_fd = _PyLong_AsInt(args[1]);
if (in_fd == -1 && PyErr_Occurred()) {
goto exit;
}
offobj = args[2];
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[3]);
if (!_PyArg_CheckPositional("_fcopyfile", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
in_fd = _PyLong_AsInt(args[0]);
if (in_fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
out_fd = _PyLong_AsInt(args[1]);
if (out_fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[2]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
int fd;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int flags;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(arg);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("writev", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("pwrite", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("pwritev", nargs, 3, 4)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[3]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
src = _PyLong_AsInt(args[0]);
if (src == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
dst = _PyLong_AsInt(args[1]);
if (dst == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("makedev", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
major = _PyLong_AsInt(args[0]);
if (major == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
minor = _PyLong_AsInt(args[1]);
if (minor == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("ftruncate", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("posix_fallocate", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("posix_fadvise", nargs, 4, 4)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!Py_off_t_converter(args[2], &length)) {
goto exit;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
advice = _PyLong_AsInt(args[3]);
if (advice == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int code;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
code = _PyLong_AsInt(arg);
if (code == -1 && PyErr_Occurred()) {
goto exit;
int status;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(arg);
if (status == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
status = _PyLong_AsInt(args[0]);
if (status == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int fd;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("fpathconf", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[3]) {
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[3]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
Py_ssize_t size;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(arg);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (flags == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
int fd;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("set_inheritable", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
inheritable = _PyLong_AsInt(args[1]);
if (inheritable == -1 && PyErr_Occurred()) {
goto exit;
int fd;
int _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("set_blocking", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
blocking = _PyLong_AsInt(args[1]);
if (blocking == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[1]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=005919eaaef3f8e6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b97bbc8cb5078540 input=a9049054013a1b77]*/
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
isfinal = _PyLong_AsInt(args[1]);
if (isfinal == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int flag;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(arg);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
long code;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
code = PyLong_AsLong(arg);
if (code == -1 && PyErr_Occurred()) {
goto exit;
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
-/*[clinic end generated code: output=68ce25024280af41 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=14e37efc4ec10be2 input=a9049054013a1b77]*/
PyObject *return_value = NULL;
int who;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
who = _PyLong_AsInt(arg);
if (who == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int resource;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
resource = _PyLong_AsInt(arg);
if (resource == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("setrlimit", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
resource = _PyLong_AsInt(args[0]);
if (resource == -1 && PyErr_Occurred()) {
goto exit;
#ifndef RESOURCE_PRLIMIT_METHODDEF
#define RESOURCE_PRLIMIT_METHODDEF
#endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */
-/*[clinic end generated code: output=ef3034f291156a34 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ad190fb33d647d1e input=a9049054013a1b77]*/
goto skip_optional_pos;
}
if (fastargs[0]) {
- if (PyFloat_Check(fastargs[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
sizehint = _PyLong_AsInt(fastargs[0]);
if (sizehint == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(fastargs[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(fastargs[1]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int fd;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
eventmask = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (eventmask == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
if (!fildes_converter(args[0], &fd)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
eventmask = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (eventmask == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
maxevents = _PyLong_AsInt(args[1]);
if (maxevents == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int fd;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
goto exit;
}
changelist = args[0];
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
maxevents = _PyLong_AsInt(args[1]);
if (maxevents == -1 && PyErr_Occurred()) {
goto exit;
#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
#define SELECT_KQUEUE_CONTROL_METHODDEF
#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
-/*[clinic end generated code: output=029f23fbe000d7f7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a055330869acbd16 input=a9049054013a1b77]*/
int seconds;
long _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
seconds = _PyLong_AsInt(arg);
if (seconds == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int signalnum;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
signalnum = _PyLong_AsInt(arg);
if (signalnum == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("signal", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
signalnum = _PyLong_AsInt(args[0]);
if (signalnum == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int signalnum;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
signalnum = _PyLong_AsInt(arg);
if (signalnum == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int signalnum;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
signalnum = _PyLong_AsInt(arg);
if (signalnum == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("siginterrupt", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
signalnum = _PyLong_AsInt(args[0]);
if (signalnum == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(args[1]);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("setitimer", nargs, 2, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
which = _PyLong_AsInt(args[0]);
if (which == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int which;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
which = _PyLong_AsInt(arg);
if (which == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("pthread_sigmask", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
how = _PyLong_AsInt(args[0]);
if (how == -1 && PyErr_Occurred()) {
goto exit;
goto exit;
}
thread_id = PyLong_AsUnsignedLongMask(args[0]);
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
signalnum = _PyLong_AsInt(args[1]);
if (signalnum == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("pidfd_send_signal", nargs, 2, 4)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
pidfd = _PyLong_AsInt(args[0]);
if (pidfd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
signalnum = _PyLong_AsInt(args[1]);
if (signalnum == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 4) {
goto skip_optional;
}
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[3]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
#ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
-/*[clinic end generated code: output=b41b4b6bd9ad4da2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dff93c869101f043 input=a9049054013a1b77]*/
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
level = _PyLong_AsInt(args[1]);
if (level == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
wbits = _PyLong_AsInt(args[1]);
if (wbits == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (!ssize_t_converter(args[2], &bufsize)) {
- goto exit;
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ bufsize = ival;
}
skip_optional_pos:
return_value = zlib_decompress_impl(module, &data, wbits, bufsize);
goto skip_optional_pos;
}
if (args[0]) {
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
level = _PyLong_AsInt(args[0]);
if (level == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
method = _PyLong_AsInt(args[1]);
if (method == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
wbits = _PyLong_AsInt(args[2]);
if (wbits == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[3]) {
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
memLevel = _PyLong_AsInt(args[3]);
if (memLevel == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[4]) {
- if (PyFloat_Check(args[4])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
strategy = _PyLong_AsInt(args[4]);
if (strategy == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[0]) {
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
wbits = _PyLong_AsInt(args[0]);
if (wbits == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (!ssize_t_converter(args[1], &max_length)) {
- goto exit;
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ max_length = ival;
}
skip_optional_pos:
return_value = zlib_Decompress_decompress_impl(self, &data, max_length);
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[0]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (!ssize_t_converter(args[0], &length)) {
- goto exit;
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ length = ival;
}
skip_optional:
return_value = zlib_Decompress_flush_impl(self, length);
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
value = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (value == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
value = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (value == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
#ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */
-/*[clinic end generated code: output=faae38ef96b88b16 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=06b6438506aab0cb input=a9049054013a1b77]*/
grp_getgrgid_impl(PyObject *module, PyObject *id)
/*[clinic end generated code: output=30797c289504a1ba input=15fa0e2ccf5cda25]*/
{
- PyObject *py_int_id, *retval = NULL;
+ PyObject *retval = NULL;
int nomem = 0;
char *buf = NULL, *buf2 = NULL;
gid_t gid;
struct group *p;
if (!_Py_Gid_Converter(id, &gid)) {
- if (!PyErr_ExceptionMatches(PyExc_TypeError)) {
- return NULL;
- }
- PyErr_Clear();
- if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
- "group id must be int, not %.200",
- Py_TYPE(id)->tp_name) < 0) {
- return NULL;
- }
- py_int_id = PyNumber_Long(id);
- if (!py_int_id)
- return NULL;
- if (!_Py_Gid_Converter(py_int_id, &gid)) {
- Py_DECREF(py_int_id);
- return NULL;
- }
- Py_DECREF(py_int_id);
+ return NULL;
}
#ifdef HAVE_GETGRGID_R
int status;
{
long x, two_valuation;
int overflow;
- PyObject *result, *odd_part, *pyint_form;
-
- if (PyFloat_Check(arg)) {
- if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "Using factorial() with floats is deprecated",
- 1) < 0)
- {
- return NULL;
- }
- PyObject *lx;
- double dx = PyFloat_AS_DOUBLE((PyFloatObject *)arg);
- if (!(Py_IS_FINITE(dx) && dx == floor(dx))) {
- PyErr_SetString(PyExc_ValueError,
- "factorial() only accepts integral values");
- return NULL;
- }
- lx = PyLong_FromDouble(dx);
- if (lx == NULL)
- return NULL;
- x = PyLong_AsLongAndOverflow(lx, &overflow);
- Py_DECREF(lx);
- }
- else {
- pyint_form = PyNumber_Index(arg);
- if (pyint_form == NULL) {
- return NULL;
- }
- x = PyLong_AsLongAndOverflow(pyint_form, &overflow);
- Py_DECREF(pyint_form);
- }
+ PyObject *result, *odd_part;
+ x = PyLong_AsLongAndOverflow(arg, &overflow);
if (x == -1 && PyErr_Occurred()) {
return NULL;
}
os_waitstatus_to_exitcode_impl(PyObject *module, PyObject *status_obj)
/*[clinic end generated code: output=db50b1b0ba3c7153 input=7fe2d7fdaea3db42]*/
{
- if (PyFloat_Check(status_obj)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- return NULL;
- }
#ifndef MS_WINDOWS
int status = _PyLong_AsInt(status_obj);
if (status == -1 && PyErr_Occurred()) {
else
#endif
{
-
- if (PyFloat_Check(fdobj)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float");
- return -1;
- }
-
fd = PyLong_AsSocket_t(fdobj);
if (fd == (SOCKET_T)(-1) && PyErr_Occurred())
return -1;
return NULL;
}
-/*[python input]
-
-class ssize_t_converter(CConverter):
- type = 'Py_ssize_t'
- converter = 'ssize_t_converter'
- c_ignored_default = "0"
-
-[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=5f34ba1b394cb8e7]*/
-
-static int
-ssize_t_converter(PyObject *obj, void *ptr)
-{
- PyObject *long_obj;
- Py_ssize_t val;
-
- /* XXX Should be replaced with PyNumber_AsSsize_t after the end of the
- deprecation period. */
- long_obj = _PyLong_FromNbIndexOrNbInt(obj);
- if (long_obj == NULL) {
- return 0;
- }
- val = PyLong_AsSsize_t(long_obj);
- Py_DECREF(long_obj);
- if (val == -1 && PyErr_Occurred()) {
- return 0;
- }
- *(Py_ssize_t *)ptr = val;
- return 1;
-}
-
/*[clinic input]
zlib.decompress
/
wbits: int(c_default="MAX_WBITS") = MAX_WBITS
The window buffer size and container format.
- bufsize: ssize_t(c_default="DEF_BUF_SIZE") = DEF_BUF_SIZE
+ bufsize: Py_ssize_t(c_default="DEF_BUF_SIZE") = DEF_BUF_SIZE
The initial output buffer size.
Returns a bytes object containing the uncompressed data.
static PyObject *
zlib_decompress_impl(PyObject *module, Py_buffer *data, int wbits,
Py_ssize_t bufsize)
-/*[clinic end generated code: output=77c7e35111dc8c42 input=21960936208e9a5b]*/
+/*[clinic end generated code: output=77c7e35111dc8c42 input=a9ac17beff1f893f]*/
{
PyObject *RetVal = NULL;
Byte *ibuf;
data: Py_buffer
The binary data to decompress.
/
- max_length: ssize_t = 0
+ max_length: Py_ssize_t = 0
The maximum allowable length of the decompressed data.
Unconsumed input data will be stored in
the unconsumed_tail attribute.
static PyObject *
zlib_Decompress_decompress_impl(compobject *self, Py_buffer *data,
Py_ssize_t max_length)
-/*[clinic end generated code: output=6e5173c74e710352 input=b85a212a012b770a]*/
+/*[clinic end generated code: output=6e5173c74e710352 input=0a95d05a3bceaeaa]*/
{
int err = Z_OK;
Py_ssize_t ibuflen, obuflen = DEF_BUF_SIZE, hard_limit;
/*[clinic input]
zlib.Decompress.flush
- length: ssize_t(c_default="DEF_BUF_SIZE") = zlib.DEF_BUF_SIZE
+ length: Py_ssize_t(c_default="DEF_BUF_SIZE") = zlib.DEF_BUF_SIZE
the initial size of the output buffer.
/
static PyObject *
zlib_Decompress_flush_impl(compobject *self, Py_ssize_t length)
-/*[clinic end generated code: output=68c75ea127cbe654 input=aa4ec37f3aef4da0]*/
+/*[clinic end generated code: output=68c75ea127cbe654 input=427f2a05a8c2113a]*/
{
int err, flush;
Py_buffer data;
}
m = Py_TYPE(o)->tp_as_number;
if (m && m->nb_int) { /* This should include subclasses of int */
- result = _PyLong_FromNbInt(o);
- if (result != NULL && !PyLong_CheckExact(result)) {
- Py_SETREF(result, _PyLong_Copy((PyLongObject *)result));
+ /* Convert using the nb_int slot, which should return something
+ of exact type int. */
+ result = m->nb_int(o);
+ if (!result || PyLong_CheckExact(result))
+ return result;
+ if (!PyLong_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "__int__ returned non-int (type %.200s)",
+ result->ob_type->tp_name);
+ Py_DECREF(result);
+ return NULL;
+ }
+ /* Issue #17576: warn if 'result' not of exact type int. */
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "__int__ returned non-int (type %.200s). "
+ "The ability to return an instance of a strict subclass of int "
+ "is deprecated, and may be removed in a future version of Python.",
+ result->ob_type->tp_name)) {
+ Py_DECREF(result);
+ return NULL;
}
+ Py_SETREF(result, _PyLong_Copy((PyLongObject *)result));
return result;
}
if (m && m->nb_index) {
- result = _PyLong_FromNbIndexOrNbInt(o);
+ result = PyNumber_Index(o);
if (result != NULL && !PyLong_CheckExact(result)) {
Py_SETREF(result, _PyLong_Copy((PyLongObject *)result));
}
}
/* __trunc__ is specified to return an Integral type,
but int() needs to return an int. */
- m = Py_TYPE(result)->tp_as_number;
- if (m == NULL || (m->nb_index == NULL && m->nb_int == NULL)) {
+ if (!PyIndex_Check(result)) {
PyErr_Format(
PyExc_TypeError,
"__trunc__ returned non-Integral (type %.200s)",
Py_DECREF(result);
return NULL;
}
- Py_SETREF(result, _PyLong_FromNbIndexOrNbInt(result));
+ Py_SETREF(result, PyNumber_Index(result));
if (result != NULL && !PyLong_CheckExact(result)) {
Py_SETREF(result, _PyLong_Copy((PyLongObject *)result));
}
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
keepends = _PyLong_AsInt(args[0]);
if (keepends == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
bytes_per_sep = _PyLong_AsInt(args[1]);
if (bytes_per_sep == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
proto = _PyLong_AsInt(args[0]);
if (proto == -1 && PyErr_Occurred()) {
goto exit;
{
return bytearray_sizeof_impl(self);
}
-/*[clinic end generated code: output=b2919f76709e48dc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=920748990279fb9d input=a9049054013a1b77]*/
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
keepends = _PyLong_AsInt(args[0]);
if (keepends == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
bytes_per_sep = _PyLong_AsInt(args[1]);
if (bytes_per_sep == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=220388917d7bf751 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a0c31faea2671a8c input=a9049054013a1b77]*/
goto skip_optional_kwonly;
}
if (args[0]) {
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
co_argcount = _PyLong_AsInt(args[0]);
if (co_argcount == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[1]) {
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
co_posonlyargcount = _PyLong_AsInt(args[1]);
if (co_posonlyargcount == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
co_kwonlyargcount = _PyLong_AsInt(args[2]);
if (co_kwonlyargcount == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[3]) {
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
co_nlocals = _PyLong_AsInt(args[3]);
if (co_nlocals == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[4]) {
- if (PyFloat_Check(args[4])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
co_stacksize = _PyLong_AsInt(args[4]);
if (co_stacksize == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[5]) {
- if (PyFloat_Check(args[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
co_flags = _PyLong_AsInt(args[5]);
if (co_flags == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[6]) {
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
co_firstlineno = _PyLong_AsInt(args[6]);
if (co_firstlineno == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=27fe34e82106b220 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f9f23e912a3955b9 input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
goto skip_optional_kwonly;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
reverse = _PyLong_AsInt(args[1]);
if (reverse == -1 && PyErr_Occurred()) {
goto exit;
{
return list___reversed___impl(self);
}
-/*[clinic end generated code: output=1ff61490c091d165 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=137db7b11196b581 input=a9049054013a1b77]*/
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
exit:
return return_value;
}
-/*[clinic end generated code: output=77bc3b2615822cb8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=46d40c8aa6d420b7 input=a9049054013a1b77]*/
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
bytes_per_sep = _PyLong_AsInt(args[1]);
if (bytes_per_sep == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=ee265a73f68b0077 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=91106ef704134b19 input=a9049054013a1b77]*/
PyObject *return_value = NULL;
int protocol;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
protocol = _PyLong_AsInt(arg);
if (protocol == -1 && PyErr_Occurred()) {
goto exit;
{
return object___dir___impl(self);
}
-/*[clinic end generated code: output=7a6d272d282308f3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b4fb62939b08baf9 input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("center", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
tabsize = _PyLong_AsInt(args[0]);
if (tabsize == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("ljust", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
if (!_PyArg_CheckPositional("rjust", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
goto skip_optional_pos;
}
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[1]);
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
keepends = _PyLong_AsInt(args[0]);
if (keepends == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
Py_ssize_t width;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(arg);
{
return unicode_sizeof_impl(self);
}
-/*[clinic end generated code: output=b91233f3722643be input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ea1aff10c743be14 input=a9049054013a1b77]*/
return v;
}
-/* _PyLong_FromNbInt: Convert the given object to a PyLongObject
- using the nb_int slot, if available. Raise TypeError if either the
- nb_int slot is not available or the result of the call to nb_int
- returns something not of type int.
-*/
-PyObject *
-_PyLong_FromNbInt(PyObject *integral)
-{
- PyNumberMethods *nb;
- PyObject *result;
-
- /* Fast path for the case that we already have an int. */
- if (PyLong_CheckExact(integral)) {
- Py_INCREF(integral);
- return integral;
- }
-
- nb = Py_TYPE(integral)->tp_as_number;
- if (nb == NULL || nb->nb_int == NULL) {
- PyErr_Format(PyExc_TypeError,
- "an integer is required (got type %.200s)",
- Py_TYPE(integral)->tp_name);
- return NULL;
- }
-
- /* Convert using the nb_int slot, which should return something
- of exact type int. */
- result = nb->nb_int(integral);
- if (!result || PyLong_CheckExact(result))
- return result;
- if (!PyLong_Check(result)) {
- PyErr_Format(PyExc_TypeError,
- "__int__ returned non-int (type %.200s)",
- Py_TYPE(result)->tp_name);
- Py_DECREF(result);
- return NULL;
- }
- /* Issue #17576: warn if 'result' not of exact type int. */
- if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
- "__int__ returned non-int (type %.200s). "
- "The ability to return an instance of a strict subclass of int "
- "is deprecated, and may be removed in a future version of Python.",
- Py_TYPE(result)->tp_name)) {
- Py_DECREF(result);
- return NULL;
- }
- return result;
-}
-
-/* Convert the given object to a PyLongObject using the nb_index or
- nb_int slots, if available (the latter is deprecated).
- Raise TypeError if either nb_index and nb_int slots are not
- available or the result of the call to nb_index or nb_int
- returns something not of type int.
- Should be replaced with PyNumber_Index after the end of the
- deprecation period.
-*/
-PyObject *
-_PyLong_FromNbIndexOrNbInt(PyObject *integral)
-{
- PyNumberMethods *nb;
- PyObject *result;
-
- /* Fast path for the case that we already have an int. */
- if (PyLong_CheckExact(integral)) {
- Py_INCREF(integral);
- return integral;
- }
-
- nb = Py_TYPE(integral)->tp_as_number;
- if (nb == NULL || (nb->nb_index == NULL && nb->nb_int == NULL)) {
- PyErr_Format(PyExc_TypeError,
- "an integer is required (got type %.200s)",
- Py_TYPE(integral)->tp_name);
- return NULL;
- }
-
- if (nb->nb_index) {
- /* Convert using the nb_index slot, which should return something
- of exact type int. */
- result = nb->nb_index(integral);
- if (!result || PyLong_CheckExact(result))
- return result;
- if (!PyLong_Check(result)) {
- PyErr_Format(PyExc_TypeError,
- "__index__ returned non-int (type %.200s)",
- Py_TYPE(result)->tp_name);
- Py_DECREF(result);
- return NULL;
- }
- /* Issue #17576: warn if 'result' not of exact type int. */
- if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
- "__index__ returned non-int (type %.200s). "
- "The ability to return an instance of a strict subclass of int "
- "is deprecated, and may be removed in a future version of Python.",
- Py_TYPE(result)->tp_name))
- {
- Py_DECREF(result);
- return NULL;
- }
- return result;
- }
-
- result = _PyLong_FromNbInt(integral);
- if (result && PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
- "an integer is required (got type %.200s). "
- "Implicit conversion to integers using __int__ is deprecated, "
- "and may be removed in a future version of Python.",
- Py_TYPE(integral)->tp_name))
- {
- Py_DECREF(result);
- return NULL;
- }
- return result;
-}
-
-
/* Allocate a new int object with size digits.
Return NULL and set exception if we run out of memory. */
v = (PyLongObject *)vv;
}
else {
- v = (PyLongObject *)_PyLong_FromNbIndexOrNbInt(vv);
+ v = (PyLongObject *)PyNumber_Index(vv);
if (v == NULL)
return -1;
do_decref = 1;
return _PyLong_AsUnsignedLongMask(op);
}
- lo = (PyLongObject *)_PyLong_FromNbIndexOrNbInt(op);
+ lo = (PyLongObject *)PyNumber_Index(op);
if (lo == NULL)
return (unsigned long)-1;
v = (PyLongObject *)vv;
}
else {
- v = (PyLongObject *)_PyLong_FromNbIndexOrNbInt(vv);
+ v = (PyLongObject *)PyNumber_Index(vv);
if (v == NULL)
return -1;
do_decref = 1;
return _PyLong_AsUnsignedLongLongMask(op);
}
- lo = (PyLongObject *)_PyLong_FromNbIndexOrNbInt(op);
+ lo = (PyLongObject *)PyNumber_Index(op);
if (lo == NULL)
return (unsigned long long)-1;
v = (PyLongObject *)vv;
}
else {
- v = (PyLongObject *)_PyLong_FromNbIndexOrNbInt(vv);
+ v = (PyLongObject *)PyNumber_Index(vv);
if (v == NULL)
return -1;
do_decref = 1;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
tabsize = _PyLong_AsInt(args[0]);
if (tabsize == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("ljust", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (!_PyArg_CheckPositional("rjust", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
if (!_PyArg_CheckPositional("center", nargs, 1, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[0]);
PyObject *return_value = NULL;
Py_ssize_t width;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(arg);
exit:
return return_value;
}
-/*[clinic end generated code: output=15be047aef999b4e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=cd5ecdbf1d9e849a input=a9049054013a1b77]*/
if (!_PyArg_CheckPositional("locking", nargs, 3, 3)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
nbytes = PyLong_AsLong(args[2]);
if (nbytes == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("setmode", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(args[0]);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[1]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
int fd;
void *_return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
fd = _PyLong_AsInt(arg);
if (fd == -1 && PyErr_Occurred()) {
goto exit;
if (!_PyArg_CheckPositional("CrtSetReportMode", nargs, 2, 2)) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
type = _PyLong_AsInt(args[0]);
if (type == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(args[1]);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
int mode;
long _return_value;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = _PyLong_AsInt(arg);
if (mode == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
unsigned int mode;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
mode = (unsigned int)PyLong_AsUnsignedLongMask(arg);
if (mode == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
#define MSVCRT_SET_ERROR_MODE_METHODDEF
#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
-/*[clinic end generated code: output=7cc6ffaf64f268f7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ab3b5ce5c1447f0e input=a9049054013a1b77]*/
if (!clinic_HKEY_converter(args[0], &key)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
index = _PyLong_AsInt(args[1]);
if (index == -1 && PyErr_Occurred()) {
goto exit;
if (!clinic_HKEY_converter(args[0], &key)) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
index = _PyLong_AsInt(args[1]);
if (index == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=015afbbd690eb59d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f4f996d40d06f14c input=a9049054013a1b77]*/
goto exit;
}
sound = args[0];
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[1]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
frequency = _PyLong_AsInt(args[0]);
if (frequency == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
duration = _PyLong_AsInt(args[1]);
if (duration == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_pos;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
type = _PyLong_AsInt(args[0]);
if (type == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=28d1cd033282723d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=16b3c1a96861cd3a input=a9049054013a1b77]*/
}
}
if (args[2]) {
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index(args[2]);
exit:
return return_value;
}
-/*[clinic end generated code: output=b7bb54c73b5433ec input=a9049054013a1b77]*/
+/*[clinic end generated code: output=484e5ffe94edf0f0 input=a9049054013a1b77]*/
PyObject *return_value = NULL;
int i;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
i = _PyLong_AsInt(arg);
if (i == -1 && PyErr_Occurred()) {
goto exit;
goto skip_optional_pos;
}
if (args[3]) {
- if (PyFloat_Check(args[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flags = _PyLong_AsInt(args[3]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[4]) {
- if (PyFloat_Check(args[4])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
dont_inherit = _PyLong_AsInt(args[4]);
if (dont_inherit == -1 && PyErr_Occurred()) {
goto exit;
}
}
if (args[5]) {
- if (PyFloat_Check(args[5])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
optimize = _PyLong_AsInt(args[5]);
if (optimize == -1 && PyErr_Occurred()) {
goto exit;
if (!noptargs) {
goto skip_optional_kwonly;
}
- if (PyFloat_Check(args[6])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
feature_version = _PyLong_AsInt(args[6]);
if (feature_version == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=29686a89b739d600 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=780fd9712ec6a6db input=a9049054013a1b77]*/
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
key = PyLong_AsLong(args[0]);
if (key == -1 && PyErr_Occurred()) {
goto exit;
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=3dc495e9c64d944e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7c31c433af88af6b input=a9049054013a1b77]*/
if (nargs < 3) {
goto skip_optional;
}
- if (PyFloat_Check(args[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
version = _PyLong_AsInt(args[2]);
if (version == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 2) {
goto skip_optional;
}
- if (PyFloat_Check(args[1])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
version = _PyLong_AsInt(args[1]);
if (version == -1 && PyErr_Occurred()) {
goto exit;
return return_value;
}
-/*[clinic end generated code: output=a859dabe8b0afeb6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=68b78f38bfe0c06d input=a9049054013a1b77]*/
PyObject *return_value = NULL;
int new_limit;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
new_limit = _PyLong_AsInt(arg);
if (new_limit == -1 && PyErr_Occurred()) {
goto exit;
if (!args) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
depth = _PyLong_AsInt(args[0]);
if (depth == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int new_val;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
new_val = _PyLong_AsInt(arg);
if (new_val == -1 && PyErr_Occurred()) {
goto exit;
PyObject *return_value = NULL;
int flag;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
flag = _PyLong_AsInt(arg);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
if (nargs < 1) {
goto skip_optional;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
depth = _PyLong_AsInt(args[0]);
if (depth == -1 && PyErr_Occurred()) {
goto exit;
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
-/*[clinic end generated code: output=39eb34a01fb9a919 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=87baa3357293ea65 input=a9049054013a1b77]*/
goto exit;
}
tb_frame = (PyFrameObject *)fastargs[1];
- if (PyFloat_Check(fastargs[2])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
tb_lasti = _PyLong_AsInt(fastargs[2]);
if (tb_lasti == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(fastargs[3])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
tb_lineno = _PyLong_AsInt(fastargs[3]);
if (tb_lineno == -1 && PyErr_Occurred()) {
goto exit;
exit:
return return_value;
}
-/*[clinic end generated code: output=3def6c06248feed8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=403778d7af5ebef9 input=a9049054013a1b77]*/
#define CONV_UNICODE "(unicode conversion error)"
-/* Explicitly check for float arguments when integers are expected.
- Return 1 for error, 0 if ok.
- XXX Should be removed after the end of the deprecation period in
- _PyLong_FromNbIndexOrNbInt. */
-static int
-float_argument_error(PyObject *arg)
-{
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- return 1;
- }
- else
- return 0;
-}
-
/* Convert a non-tuple argument. Return NULL if conversion went OK,
or a string with a message describing the failure. The message is
formatted as "must be <desired type>, not <actual type>".
case 'b': { /* unsigned byte -- very short int */
char *p = va_arg(*p_va, char *);
- long ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = PyLong_AsLong(arg);
+ long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else if (ival < 0) {
case 'B': {/* byte sized bitfield - both signed and unsigned
values allowed */
char *p = va_arg(*p_va, char *);
- long ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = PyLong_AsUnsignedLongMask(arg);
- if (ival == -1 && PyErr_Occurred())
+ unsigned long ival = PyLong_AsUnsignedLongMask(arg);
+ if (ival == (unsigned long)-1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else
*p = (unsigned char) ival;
case 'h': {/* signed short int */
short *p = va_arg(*p_va, short *);
- long ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = PyLong_AsLong(arg);
+ long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else if (ival < SHRT_MIN) {
case 'H': { /* short int sized bitfield, both signed and
unsigned allowed */
unsigned short *p = va_arg(*p_va, unsigned short *);
- long ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = PyLong_AsUnsignedLongMask(arg);
- if (ival == -1 && PyErr_Occurred())
+ unsigned long ival = PyLong_AsUnsignedLongMask(arg);
+ if (ival == (unsigned long)-1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else
*p = (unsigned short) ival;
case 'i': {/* signed int */
int *p = va_arg(*p_va, int *);
- long ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = PyLong_AsLong(arg);
+ long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else if (ival > INT_MAX) {
case 'I': { /* int sized bitfield, both signed and
unsigned allowed */
unsigned int *p = va_arg(*p_va, unsigned int *);
- unsigned int ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = (unsigned int)PyLong_AsUnsignedLongMask(arg);
- if (ival == (unsigned int)-1 && PyErr_Occurred())
+ unsigned long ival = PyLong_AsUnsignedLongMask(arg);
+ if (ival == (unsigned long)-1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else
- *p = ival;
+ *p = (unsigned int) ival;
break;
}
PyObject *iobj;
Py_ssize_t *p = va_arg(*p_va, Py_ssize_t *);
Py_ssize_t ival = -1;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
iobj = PyNumber_Index(arg);
if (iobj != NULL) {
ival = PyLong_AsSsize_t(iobj);
}
case 'l': {/* long int */
long *p = va_arg(*p_va, long *);
- long ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = PyLong_AsLong(arg);
+ long ival = PyLong_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else
case 'L': {/* long long */
long long *p = va_arg( *p_va, long long * );
- long long ival;
- if (float_argument_error(arg))
- RETURN_ERR_OCCURRED;
- ival = PyLong_AsLongLong(arg);
+ long long ival = PyLong_AsLongLong(arg);
if (ival == (long long)-1 && PyErr_Occurred())
RETURN_ERR_OCCURRED;
else
# XXX PyFloat_Check can be removed after the end of the
# deprecation in _PyLong_FromNbIndexOrNbInt.
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{paramname} = _PyLong_AsInt({argname});
if ({paramname} == -1 && PyErr_Occurred()) {{{{
goto exit;
def parse_arg(self, argname, displayname):
if self.format_unit == 'b':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{{{{
long ival = PyLong_AsLong({argname});
if (ival == -1 && PyErr_Occurred()) {{{{
""".format(argname=argname, paramname=self.name)
elif self.format_unit == 'B':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{{{{
- long ival = PyLong_AsUnsignedLongMask({argname});
- if (ival == -1 && PyErr_Occurred()) {{{{
+ unsigned long ival = PyLong_AsUnsignedLongMask({argname});
+ if (ival == (unsigned long)-1 && PyErr_Occurred()) {{{{
goto exit;
}}}}
else {{{{
def parse_arg(self, argname, displayname):
if self.format_unit == 'h':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{{{{
long ival = PyLong_AsLong({argname});
if (ival == -1 && PyErr_Occurred()) {{{{
def parse_arg(self, argname, displayname):
if self.format_unit == 'H':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{paramname} = (unsigned short)PyLong_AsUnsignedLongMask({argname});
if ({paramname} == (unsigned short)-1 && PyErr_Occurred()) {{{{
goto exit;
def parse_arg(self, argname, displayname):
if self.format_unit == 'i':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{paramname} = _PyLong_AsInt({argname});
if ({paramname} == -1 && PyErr_Occurred()) {{{{
goto exit;
def parse_arg(self, argname, displayname):
if self.format_unit == 'I':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{paramname} = (unsigned int)PyLong_AsUnsignedLongMask({argname});
if ({paramname} == (unsigned int)-1 && PyErr_Occurred()) {{{{
goto exit;
def parse_arg(self, argname, displayname):
if self.format_unit == 'l':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{paramname} = PyLong_AsLong({argname});
if ({paramname} == -1 && PyErr_Occurred()) {{{{
goto exit;
def parse_arg(self, argname, displayname):
if self.format_unit == 'L':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{paramname} = PyLong_AsLongLong({argname});
if ({paramname} == -1 && PyErr_Occurred()) {{{{
goto exit;
def parse_arg(self, argname, displayname):
if self.format_unit == 'n':
return """
- if (PyFloat_Check({argname})) {{{{
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }}}}
{{{{
Py_ssize_t ival = -1;
PyObject *iobj = PyNumber_Index({argname});