mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 05:01:14 -07:00
Bump pyparsing from 3.1.1 to 3.1.2 (#2296)
* Bump pyparsing from 3.1.1 to 3.1.2 Bumps [pyparsing](https://github.com/pyparsing/pyparsing) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/pyparsing/pyparsing/releases) - [Changelog](https://github.com/pyparsing/pyparsing/blob/master/CHANGES) - [Commits](https://github.com/pyparsing/pyparsing/compare/3.1.1...pyparsing_3.1.2) --- updated-dependencies: - dependency-name: pyparsing dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Update pyparsing==3.1.2 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
1d96e0f859
commit
26358427ce
12 changed files with 610 additions and 706 deletions
|
@ -14,11 +14,13 @@ from .util import (
|
|||
from .unicode import pyparsing_unicode as ppu
|
||||
|
||||
|
||||
class ExceptionWordUnicode(ppu.Latin1, ppu.LatinA, ppu.LatinB, ppu.Greek, ppu.Cyrillic):
|
||||
class _ExceptionWordUnicodeSet(
|
||||
ppu.Latin1, ppu.LatinA, ppu.LatinB, ppu.Greek, ppu.Cyrillic
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
_extract_alphanums = _collapse_string_to_ranges(ExceptionWordUnicode.alphanums)
|
||||
_extract_alphanums = _collapse_string_to_ranges(_ExceptionWordUnicodeSet.alphanums)
|
||||
_exception_word_extractor = re.compile("([" + _extract_alphanums + "]{1,16})|.")
|
||||
|
||||
|
||||
|
@ -86,41 +88,39 @@ class ParseBaseException(Exception):
|
|||
ret.append(" " * (exc.column - 1) + "^")
|
||||
ret.append(f"{type(exc).__name__}: {exc}")
|
||||
|
||||
if depth > 0:
|
||||
callers = inspect.getinnerframes(exc.__traceback__, context=depth)
|
||||
seen = set()
|
||||
for i, ff in enumerate(callers[-depth:]):
|
||||
frm = ff[0]
|
||||
if depth <= 0:
|
||||
return "\n".join(ret)
|
||||
|
||||
f_self = frm.f_locals.get("self", None)
|
||||
if isinstance(f_self, ParserElement):
|
||||
if not frm.f_code.co_name.startswith(
|
||||
("parseImpl", "_parseNoCache")
|
||||
):
|
||||
continue
|
||||
if id(f_self) in seen:
|
||||
continue
|
||||
seen.add(id(f_self))
|
||||
callers = inspect.getinnerframes(exc.__traceback__, context=depth)
|
||||
seen = set()
|
||||
for ff in callers[-depth:]:
|
||||
frm = ff[0]
|
||||
|
||||
self_type = type(f_self)
|
||||
ret.append(
|
||||
f"{self_type.__module__}.{self_type.__name__} - {f_self}"
|
||||
)
|
||||
f_self = frm.f_locals.get("self", None)
|
||||
if isinstance(f_self, ParserElement):
|
||||
if not frm.f_code.co_name.startswith(("parseImpl", "_parseNoCache")):
|
||||
continue
|
||||
if id(f_self) in seen:
|
||||
continue
|
||||
seen.add(id(f_self))
|
||||
|
||||
elif f_self is not None:
|
||||
self_type = type(f_self)
|
||||
ret.append(f"{self_type.__module__}.{self_type.__name__}")
|
||||
self_type = type(f_self)
|
||||
ret.append(f"{self_type.__module__}.{self_type.__name__} - {f_self}")
|
||||
|
||||
else:
|
||||
code = frm.f_code
|
||||
if code.co_name in ("wrapper", "<module>"):
|
||||
continue
|
||||
elif f_self is not None:
|
||||
self_type = type(f_self)
|
||||
ret.append(f"{self_type.__module__}.{self_type.__name__}")
|
||||
|
||||
ret.append(code.co_name)
|
||||
else:
|
||||
code = frm.f_code
|
||||
if code.co_name in ("wrapper", "<module>"):
|
||||
continue
|
||||
|
||||
depth -= 1
|
||||
if not depth:
|
||||
break
|
||||
ret.append(code.co_name)
|
||||
|
||||
depth -= 1
|
||||
if not depth:
|
||||
break
|
||||
|
||||
return "\n".join(ret)
|
||||
|
||||
|
@ -220,8 +220,10 @@ class ParseBaseException(Exception):
|
|||
|
||||
Example::
|
||||
|
||||
# an expression to parse 3 integers
|
||||
expr = pp.Word(pp.nums) * 3
|
||||
try:
|
||||
# a failing parse - the third integer is prefixed with "A"
|
||||
expr.parse_string("123 456 A789")
|
||||
except pp.ParseException as pe:
|
||||
print(pe.explain(depth=0))
|
||||
|
@ -244,8 +246,7 @@ class ParseBaseException(Exception):
|
|||
return self.explain_exception(self, depth)
|
||||
|
||||
# fmt: off
|
||||
@replaced_by_pep8(mark_input_line)
|
||||
def markInputline(self): ...
|
||||
markInputline = replaced_by_pep8("markInputline", mark_input_line)
|
||||
# fmt: on
|
||||
|
||||
|
||||
|
@ -255,16 +256,16 @@ class ParseException(ParseBaseException):
|
|||
|
||||
Example::
|
||||
|
||||
integer = Word(nums).set_name("integer")
|
||||
try:
|
||||
Word(nums).set_name("integer").parse_string("ABC")
|
||||
integer.parse_string("ABC")
|
||||
except ParseException as pe:
|
||||
print(pe)
|
||||
print("column: {}".format(pe.column))
|
||||
print(f"column: {pe.column}")
|
||||
|
||||
prints::
|
||||
|
||||
Expected integer (at char 0), (line:1, col:1)
|
||||
column: 1
|
||||
Expected integer (at char 0), (line:1, col:1) column: 1
|
||||
|
||||
"""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue