summaryrefslogtreecommitdiff
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2017-02-02 19:17:51 +0000
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2017-02-02 19:17:51 +0000
commitb8cf82474245d48753ae34b76a272d5120895add (patch)
tree8bec37e99a342ac40fc8a0619897feaad7615061 /Lib/test/test_re.py
parent474ecf16ed434144efc0e1de383efda76f011e3f (diff)
parent14593e19e199dd34f268b35987ddb288bf022039 (diff)
downloadcpython-b8cf82474245d48753ae34b76a272d5120895add.tar.gz
Closes #24875: Merged fix from 3.6.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 4bdaa4b6c6..c90bdc9609 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,12 +1,9 @@
from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
cpython_only, captured_stdout
-import io
import locale
import re
import sre_compile
import string
-import sys
-import traceback
import unittest
import warnings
from re import Scanner
@@ -126,7 +123,7 @@ class ReTests(unittest.TestCase):
(chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7)+chr(8)))
for c in 'cdehijklmopqsuwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':
with self.subTest(c):
- with self.assertWarns(DeprecationWarning):
+ with self.assertRaises(re.error):
self.assertEqual(re.sub('a', '\\' + c, 'a'), '\\' + c)
self.assertEqual(re.sub(r'^\s*', 'X', 'test'), 'Xtest')
@@ -1506,7 +1503,7 @@ class ReTests(unittest.TestCase):
long_overflow = 2**128
self.assertRaises(TypeError, re.finditer, "a", {})
with self.assertRaises(OverflowError):
- _sre.compile("abc", 0, [long_overflow], 0, [], [])
+ _sre.compile("abc", 0, [long_overflow], 0, {}, ())
with self.assertRaises(TypeError):
_sre.compile({}, 0, [], 0, [], [])