From 82895c5310994843e421781e1e05a3577c98dcd3 Mon Sep 17 00:00:00 2001 From: Konstantinos Tselepakis Date: Fri, 9 Feb 2024 19:27:53 +0200 Subject: [PATCH] Cleanup unused regex patterns --- multipart/multipart.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/multipart/multipart.py b/multipart/multipart.py index e1d10fc..6ec1364 100644 --- a/multipart/multipart.py +++ b/multipart/multipart.py @@ -2,7 +2,6 @@ from .exceptions import * import os -import re import sys import shutil import logging @@ -67,16 +66,6 @@ ord_char = lambda c: c join_bytes = lambda b: bytes(list(b)) -# These are regexes for parsing header values. -SPECIAL_CHARS = re.escape(b'()<>@,;:\\"/[]?={} \t') -QUOTED_STR = br'"(?:\\.|[^"])*"' -VALUE_STR = br'(?:[^' + SPECIAL_CHARS + br']+|' + QUOTED_STR + br')' -OPTION_RE_STR = ( - br'(?:;|^)\s*([^' + SPECIAL_CHARS + br']+)\s*=\s*(' + VALUE_STR + br')' -) -OPTION_RE = re.compile(OPTION_RE_STR) -QUOTE = b'"'[0] - def parse_options_header(value: Union[str, bytes]) -> Tuple[bytes, Dict[bytes, bytes]]: """