diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-01-07 22:48:01 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-01-07 22:48:01 +0000 |
commit | c3bc61051d7f12b4c682efa7a5460bbc8815649e (patch) | |
tree | b6d19e96ba3c397fb8278eeb9b68170db92630ba /net-analyzer/graphite-web/files | |
parent | 3517852e3b8a68d1e997770fc0650c5053bafc6c (diff) |
gentoo resync : 07.01.2022
Diffstat (limited to 'net-analyzer/graphite-web/files')
-rw-r--r-- | net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch b/net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch new file mode 100644 index 000000000000..6a1c44ff0109 --- /dev/null +++ b/net-analyzer/graphite-web/files/graphite-web-1.1.8-pyparsing3.patch @@ -0,0 +1,60 @@ +Modified to apply on 1.1.8 release + +From 5de8405307ded14930b3381380e9f91e583172a9 Mon Sep 17 00:00:00 2001 +From: parrotpock <51694161+parrotpock@users.noreply.github.com> +Date: Mon, 15 Nov 2021 17:39:23 +0100 +Subject: [PATCH] Fix pyparsing > 3.0 compatibility issue. (#2727) + +* Fix bool() issue in recursion termination check. + +The behaviour of ParsedResults seems to have changed in the way that +the usage of pop() along with the bool() check on the object interact +wrt checking if there are further elements in the parsed structure to +consume. In version > 3.0 bool() checks whether either the internal +_toklist or _tokdict members contain items left to consume and returns +True if either do, whereas pop with no arguments will only consume from +the underlying list. That means that we would get a True in the if +condition in this code, whereas a subsequent call to pop() would throw +an exception. Calling asList() forces the use of the list representation +in the bool check here and so fixes this issue. + +* Fix pyparsing backwards compatibility issue. + +* Remove upper-bound on pin. + +* Add pyparsing3 test target for versions >= 3.0.6 + +* Remove try/except, use dictionary key index syntax + +Co-authored-by: Ubuntu <ubuntu@ip-172-31-7-19.eu-west-1.compute.internal> +--- + webapp/graphite/render/evaluator.py | 2 +- + webapp/graphite/render/grammar_unsafe.py | 2 +- + 4 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/webapp/graphite/render/evaluator.py b/webapp/graphite/render/evaluator.py +index 748626ed0c..12179dcc44 100644 +--- a/webapp/graphite/render/evaluator.py ++++ b/webapp/graphite/render/evaluator.py +@@ -58,7 +58,7 @@ def evaluateTokens(requestContext, tokens, replacements=None, pipedArg=None): + return evaluateTokens(requestContext, tokens.template, arglist) + + if tokens.expression: +- if tokens.expression.pipedCalls: ++ if tokens.expression.pipedCalls.asList(): + # when the expression has piped calls, we pop the right-most call and pass the remaining + # expression into it via pipedArg, to get the same result as a nested call + rightMost = tokens.expression.pipedCalls.pop() +diff --git a/webapp/graphite/render/grammar_unsafe.py b/webapp/graphite/render/grammar_unsafe.py +index f25b5eff8f..2481176b53 100644 +--- a/webapp/graphite/render/grammar_unsafe.py ++++ b/webapp/graphite/render/grammar_unsafe.py +@@ -80,7 +80,7 @@ + + + def setRaw(s, loc, toks): +- toks[0].raw = s[toks[0].start:toks[0].end] ++ toks[0]['raw'] = s[toks[0].start:toks[0].end] + + + call = Group( |