Skip to content

Commit 040ed5c

Browse files
Clean up
1 parent ba84635 commit 040ed5c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Lib/test/test_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def testAttributes(self):
502502
'start' : 0, 'reason' : 'ordinal not in range'}),
503503
(UnicodeDecodeError, ('ascii', bytearray(b'\xff'), 0, 1,
504504
'ordinal not in range'), {},
505-
{'args' : ('ascii', (b'\xff'), 0, 1,
505+
{'args' : ('ascii', b'\xff', 0, 1,
506506
'ordinal not in range'),
507507
'encoding' : 'ascii', 'object' : b'\xff',
508508
'start' : 0, 'reason' : 'ordinal not in range'}),
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
:exc:`UnicodeError`, :exc:`UnicodeDecodeError` and :exc:`UnicodeEncodeError`
2-
now update the ``args`` tuple.
1+
:exc:`UnicodeDecodeError` and :exc:`UnicodeEncodeError` now update the ``args``
2+
tuple.

Objects/exceptions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,9 +3219,9 @@ unicode_error_adjust_end(Py_ssize_t end, Py_ssize_t objlen)
32193219
}
32203220

32213221
#define PyUnicodeError_Check(PTR) \
3222-
PyObject_TypeCheck((PTR), (PyTypeObject *)PyExc_UnicodeError)
3222+
PyObject_TypeCheck((PTR), (PyTypeObject *)PyExc_UnicodeError)
32233223
#define PyUnicodeErrorObject_CAST(op) \
3224-
(assert(PyUnicodeError_Check(op)), ((PyUnicodeErrorObject *)(op)))
3224+
(assert(PyUnicodeError_Check(op)), ((PyUnicodeErrorObject *)(op)))
32253225

32263226
static PyObject *
32273227
UnicodeError_args_get(PyObject *op, void *context)

0 commit comments

Comments
 (0)