Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3c6c67b

Browse files
BoboTiGmsullivan
authored andcommitted
Fix all DeprecationWarning: invalid escape sequence (#6195)
1 parent cdfca4f commit 3c6c67b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

misc/incremental_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def filter_daemon_stats(output: str) -> Tuple[str, Dict[str, Any]]:
165165
lines = output.splitlines()
166166
output_lines = []
167167
for line in lines:
168-
m = re.match('(\w+)\s+:\s+(.*)', line)
168+
m = re.match(r'(\w+)\s+:\s+(.*)', line)
169169
if m:
170170
key, value = m.groups()
171171
stats[key] = value

scripts/find_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_mypy(mypy_and_args: List[str], filename: str, tmp_name: str) -> str:
4242
return proc.stdout.decode(encoding="utf-8")
4343

4444
def get_revealed_type(line: str, relevant_file: str, relevant_line: int) -> Optional[str]:
45-
m = re.match("(.+?):(\d+): error: Revealed type is '(.*)'$", line)
45+
m = re.match(r"(.+?):(\d+): error: Revealed type is '(.*)'$", line)
4646
if (m and
4747
int(m.group(2)) == relevant_line and
4848
os.path.samefile(relevant_file, m.group(1))):

test-data/stdlib-samples/3.2/incomplete/urllib/parse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ def splitquery(url):
943943
global _queryprog
944944
if _queryprog is None:
945945
import re
946-
_queryprog = re.compile('^(.*)\?([^?]*)$')
946+
_queryprog = re.compile(r'^(.*)\?([^?]*)$')
947947

948948
match = _queryprog.match(url)
949949
if match: return match.group(1, 2)

0 commit comments

Comments
 (0)