Remove debugpy.compat, custom !j formatter for JSON, and related helpers.

This commit is contained in:
Pavel Minaev 2022-04-12 18:30:48 -07:00 committed by Pavel Minaev
parent 1965b47034
commit 0f428178b0
31 changed files with 240 additions and 408 deletions

View file

@ -8,8 +8,6 @@
import py.path
import re
from debugpy.common import compat
_marked_line_numbers_cache = {}
@ -34,13 +32,13 @@ def get_marked_line_numbers(path):
except KeyError:
pass
# Read as bytes, to avoid decoding errors on Python 3.
# Read as bytes to avoid decoding errors.
with open(path, "rb") as f:
lines = {}
for i, line in enumerate(f):
match = re.search(br"#\s*@(.+?)\s*$", line)
if match:
markers = compat.force_unicode(match.group(1), "ascii")
markers = match.group(1).decode("ascii")
for marker in markers.split(","):
lines[marker] = i + 1