summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_optparse.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-10-04 17:09:49 (GMT)
committerGitHub <noreply@github.com>2017-10-04 17:09:49 (GMT)
commit0b5e61ddca73ad4fe597fb15065115b0285c8849 (patch)
tree67819288e77e0c1835ab7e04af83f741e77cfea8 /Lib/test/test_optparse.py
parent8d5a3aad2f805dc0ea40829b751f58aa6c75305d (diff)
downloadcpython-0b5e61ddca73ad4fe597fb15065115b0285c8849.zip
cpython-0b5e61ddca73ad4fe597fb15065115b0285c8849.tar.gz
cpython-0b5e61ddca73ad4fe597fb15065115b0285c8849.tar.bz2
bpo-30397: Add re.Pattern and re.Match. (#1646)
Diffstat (limited to 'Lib/test/test_optparse.py')
-rw-r--r--Lib/test/test_optparse.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
index 91a0319..437fdd2 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -24,8 +24,6 @@ from optparse import make_option, Option, \
from optparse import _match_abbrev
from optparse import _parse_num
-retype = type(re.compile(''))
-
class InterceptedError(Exception):
def __init__(self,
error_message=None,
@@ -107,7 +105,7 @@ Args were %(args)s.""" % locals ())
func(*args, **kwargs)
except expected_exception as err:
actual_message = str(err)
- if isinstance(expected_message, retype):
+ if isinstance(expected_message, re.Pattern):
self.assertTrue(expected_message.search(actual_message),
"""\
expected exception message pattern: