mirror of
https://github.com/python/cpython
synced 2024-09-05 08:17:45 +00:00
Remove trailing spaces. (GH-28706)
This commit is contained in:
parent
dc878240dc
commit
a5a56154f1
|
@ -1299,7 +1299,7 @@ def _check_error(self, code, errtext,
|
||||||
self.assertEqual(err.end_lineno, end_lineno)
|
self.assertEqual(err.end_lineno, end_lineno)
|
||||||
if end_offset is not None:
|
if end_offset is not None:
|
||||||
self.assertEqual(err.end_offset, end_offset)
|
self.assertEqual(err.end_offset, end_offset)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.fail("compile() did not raise SyntaxError")
|
self.fail("compile() did not raise SyntaxError")
|
||||||
|
|
||||||
|
@ -1439,7 +1439,7 @@ def test_kwargs_last3(self):
|
||||||
self._check_error("int(**{'base': 10}, *['2'])",
|
self._check_error("int(**{'base': 10}, *['2'])",
|
||||||
"iterable argument unpacking follows "
|
"iterable argument unpacking follows "
|
||||||
"keyword argument unpacking")
|
"keyword argument unpacking")
|
||||||
|
|
||||||
def test_generator_in_function_call(self):
|
def test_generator_in_function_call(self):
|
||||||
self._check_error("foo(x, y for y in range(3) for z in range(2) if z , p)",
|
self._check_error("foo(x, y for y in range(3) for z in range(2) if z , p)",
|
||||||
"Generator expression must be parenthesized",
|
"Generator expression must be parenthesized",
|
||||||
|
|
|
@ -1933,7 +1933,7 @@ def test_string(self):
|
||||||
c"""', """\
|
c"""', """\
|
||||||
STRING 'rb"\""a\\\\\\nb\\\\\\nc"\""' (1, 0) (3, 4)
|
STRING 'rb"\""a\\\\\\nb\\\\\\nc"\""' (1, 0) (3, 4)
|
||||||
""")
|
""")
|
||||||
|
|
||||||
self.check_tokenize('f"abc"', """\
|
self.check_tokenize('f"abc"', """\
|
||||||
STRING 'f"abc"' (1, 0) (1, 6)
|
STRING 'f"abc"' (1, 0) (1, 6)
|
||||||
""")
|
""")
|
||||||
|
|
|
@ -408,7 +408,7 @@ termios_tcsetwinsize_impl(PyObject *module, int fd, PyObject *winsz)
|
||||||
}
|
}
|
||||||
Py_XDECREF(tmp_item);
|
Py_XDECREF(tmp_item);
|
||||||
tmp_item = PySequence_GetItem(winsz, 1);
|
tmp_item = PySequence_GetItem(winsz, 1);
|
||||||
winsz_1 = PyLong_AsLong(tmp_item);
|
winsz_1 = PyLong_AsLong(tmp_item);
|
||||||
if (winsz_1 == -1 && PyErr_Occurred()) {
|
if (winsz_1 == -1 && PyErr_Occurred()) {
|
||||||
Py_XDECREF(tmp_item);
|
Py_XDECREF(tmp_item);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -150,7 +150,7 @@ static PyMethodDef tokenize_methods[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyModuleDef_Slot tokenizemodule_slots[] = {
|
static PyModuleDef_Slot tokenizemodule_slots[] = {
|
||||||
{Py_mod_exec, tokenizemodule_exec},
|
{Py_mod_exec, tokenizemodule_exec},
|
||||||
{0, NULL}
|
{0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2485,7 +2485,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
|
||||||
switch (Py_SIZE(item)) {
|
switch (Py_SIZE(item)) {
|
||||||
case -1: b = -(sdigit) ((PyLongObject*)item)->ob_digit[0]; break;
|
case -1: b = -(sdigit) ((PyLongObject*)item)->ob_digit[0]; break;
|
||||||
// Note: the continue goes to the top of the "while" loop that iterates over the elements
|
// Note: the continue goes to the top of the "while" loop that iterates over the elements
|
||||||
case 0: Py_DECREF(item); continue;
|
case 0: Py_DECREF(item); continue;
|
||||||
case 1: b = ((PyLongObject*)item)->ob_digit[0]; break;
|
case 1: b = ((PyLongObject*)item)->ob_digit[0]; break;
|
||||||
default: b = PyLong_AsLongAndOverflow(item, &overflow); break;
|
default: b = PyLong_AsLongAndOverflow(item, &overflow); break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue