Skip to content

Commit be982a0

Browse files
committed
remove useless consistent parameter
1 parent 01b5f22 commit be982a0

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

Include/cpython/pyerrors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ PyAPI_FUNC(void) _PyErr_ChainExceptions1(PyObject *);
9797
PyAPI_FUNC(int) _PyUnicodeError_GetParams(
9898
PyObject *self,
9999
PyObject **obj, Py_ssize_t *objlen,
100-
Py_ssize_t *start, Py_ssize_t *end, int *consistent,
100+
Py_ssize_t *start, Py_ssize_t *end,
101101
int as_bytes);
102102

103103
PyAPI_FUNC(PyObject*) PyUnstable_Exc_PrepReraiseStar(

Objects/exceptions.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,18 +2850,15 @@ unicode_error_adjust_end(Py_ssize_t end, Py_ssize_t objlen)
28502850
* objlen The 'object' length.
28512851
* start The clipped 'start' attribute.
28522852
* end The clipped 'end' attribute.
2853-
* consistent Indicate whetehr 'start' and 'end' are consistent.
28542853
* as_bytes Indicate whether the underlying 'object' is a bytes object.
28552854
*
2856-
* The 'obj', 'objlen', 'start', 'end' and 'consistent' parameters may
2857-
* be NULL to indicate that the parameter does not need to be stored.
2858-
*
2859-
* The 'consistent' value is only set if 'start', and 'end' are retrieved.
2855+
* The 'obj', 'objlen', 'start' and 'end' parameters may be NULL
2856+
* to indicate that the parameter does not need to be stored.
28602857
*/
28612858
int
28622859
_PyUnicodeError_GetParams(PyObject *self,
28632860
PyObject **obj, Py_ssize_t *objlen,
2864-
Py_ssize_t *start, Py_ssize_t *end, int *consistent,
2861+
Py_ssize_t *start, Py_ssize_t *end,
28652862
int as_bytes)
28662863
{
28672864
assert(as_bytes == 0 || as_bytes == 1);
@@ -2877,7 +2874,6 @@ _PyUnicodeError_GetParams(PyObject *self,
28772874
if (objlen != NULL) {
28782875
*objlen = n;
28792876
}
2880-
28812877
if (start != NULL) {
28822878
*start = unicode_error_adjust_start(exc->start, n);
28832879
assert(*start >= 0);
@@ -2888,11 +2884,6 @@ _PyUnicodeError_GetParams(PyObject *self,
28882884
assert(*end >= 0);
28892885
assert(*end <= n);
28902886
}
2891-
2892-
if (start != NULL && end != NULL && consistent != NULL) {
2893-
*consistent = *start < *end ? 1 : 0;
2894-
}
2895-
28962887
if (obj != NULL) {
28972888
*obj = r;
28982889
}
@@ -2944,21 +2935,21 @@ PyUnicodeTranslateError_GetObject(PyObject *self)
29442935
int
29452936
PyUnicodeEncodeError_GetStart(PyObject *self, Py_ssize_t *start)
29462937
{
2947-
return _PyUnicodeError_GetParams(self, NULL, NULL, start, NULL, NULL, false);
2938+
return _PyUnicodeError_GetParams(self, NULL, NULL, start, NULL, false);
29482939
}
29492940

29502941

29512942
int
29522943
PyUnicodeDecodeError_GetStart(PyObject *self, Py_ssize_t *start)
29532944
{
2954-
return _PyUnicodeError_GetParams(self, NULL, NULL, start, NULL, NULL, true);
2945+
return _PyUnicodeError_GetParams(self, NULL, NULL, start, NULL, true);
29552946
}
29562947

29572948

29582949
int
29592950
PyUnicodeTranslateError_GetStart(PyObject *self, Py_ssize_t *start)
29602951
{
2961-
return _PyUnicodeError_GetParams(self, NULL, NULL, start, NULL, NULL, false);
2952+
return _PyUnicodeError_GetParams(self, NULL, NULL, start, NULL, false);
29622953
}
29632954

29642955
// --- PyUnicodeEncodeObject: 'start' setters ---------------------------------
@@ -2988,21 +2979,21 @@ PyUnicodeTranslateError_SetStart(PyObject *self, Py_ssize_t start)
29882979
int
29892980
PyUnicodeEncodeError_GetEnd(PyObject *self, Py_ssize_t *end)
29902981
{
2991-
return _PyUnicodeError_GetParams(self, NULL, NULL, NULL, end, NULL, false);
2982+
return _PyUnicodeError_GetParams(self, NULL, NULL, NULL, end, false);
29922983
}
29932984

29942985

29952986
int
29962987
PyUnicodeDecodeError_GetEnd(PyObject *self, Py_ssize_t *end)
29972988
{
2998-
return _PyUnicodeError_GetParams(self, NULL, NULL, NULL, end, NULL, true);
2989+
return _PyUnicodeError_GetParams(self, NULL, NULL, NULL, end, true);
29992990
}
30002991

30012992

30022993
int
30032994
PyUnicodeTranslateError_GetEnd(PyObject *self, Py_ssize_t *end)
30042995
{
3005-
return _PyUnicodeError_GetParams(self, NULL, NULL, NULL, end, NULL, false);
2996+
return _PyUnicodeError_GetParams(self, NULL, NULL, NULL, end, false);
30062997
}
30072998

30082999
// --- PyUnicodeEncodeObject: 'end' setters -----------------------------------

0 commit comments

Comments
 (0)