[3.10] gh-90568: Fix exception type for \N with a named sequence in RE (GH-91665) (GH-91830)

re.error is now raised instead of TypeError.
(cherry picked from commit 6ccfa31421393910b52936e0447625db06f2a655)
3 files changed