diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-05-08 14:10:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-08 14:10:11 (GMT) |
commit | 3680ebed7f3e529d01996dd0318601f9f0d02b4b (patch) | |
tree | 7889885b7ce3089f5ce5d02d88e7a55518644aae /Tools | |
parent | c826867b7c1bb69639290d8df0f850ec3f9a6c72 (diff) | |
download | cpython-3680ebed7f3e529d01996dd0318601f9f0d02b4b.zip cpython-3680ebed7f3e529d01996dd0318601f9f0d02b4b.tar.gz cpython-3680ebed7f3e529d01996dd0318601f9f0d02b4b.tar.bz2 |
bpo-44712: Replace "type(literal)" with corresponding builtin types (GH-27294)
I suppose it is a remnants of very old code written when str, int, list, dict, etc
were functions and not classes.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/mailerdaemon.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/scripts/mailerdaemon.py b/Tools/scripts/mailerdaemon.py index 635e548..9595ee4 100755 --- a/Tools/scripts/mailerdaemon.py +++ b/Tools/scripts/mailerdaemon.py @@ -70,7 +70,7 @@ emparse_list_list = [ # compile the re's in the list and store them in-place. for i in range(len(emparse_list_list)): x = emparse_list_list[i] - if type(x) is type(''): + if isinstance(x, str): x = re.compile(x, re.MULTILINE) else: xl = [] @@ -105,7 +105,7 @@ def emparse_list(fp, sub): emails = [] reason = None for regexp in emparse_list_list: - if type(regexp) is type(()): + if isinstance(regexp, tuple): res = regexp[0].search(data, 0, from_index) if res is not None: try: @@ -134,7 +134,7 @@ def emparse_list(fp, sub): if reason[:15] == 'returned mail: ': reason = reason[15:] for regexp in emparse_list_reason: - if type(regexp) is type(''): + if isinstance(regexp, str): for i in range(len(emails)-1,-1,-1): email = emails[i] exp = re.compile(re.escape(email).join(regexp.split('<>')), re.MULTILINE) |