From 55998a9d054326dc598cc3ea8bac572a0d0344a2 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 1 Apr 2024 03:54:27 +0000 Subject: [PATCH] Make compatible with Pygments >= 2.12 (#264). Version 2.12.0 of pygments, released in 2022. changed the signature of HtmlFormatter.wrap, removing one argument. This makes several subclasses incompatible with those versions of pygments. This commit adjusts the signatures to remove that unused argument, and adjusts the call points accordingly. --- analyzer/python/ikos/highlight.py | 4 ++-- analyzer/python/ikos/view.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/analyzer/python/ikos/highlight.py b/analyzer/python/ikos/highlight.py index 2726c327..486dc9fb 100644 --- a/analyzer/python/ikos/highlight.py +++ b/analyzer/python/ikos/highlight.py @@ -56,14 +56,14 @@ def __init__(self): def get_style_defs(self, cl): return '' - def wrap(self, src, out): + def wrap(self, src): pass def dummy_highlight(data, lexer, formatter): lines = ((1, html.escape(line)) for line in data.split('\n')) code = '' - for _, line in formatter.wrap(lines, None): + for _, line in formatter.wrap(lines): code += line return code diff --git a/analyzer/python/ikos/view.py b/analyzer/python/ikos/view.py index 4e9ed5d6..721df195 100644 --- a/analyzer/python/ikos/view.py +++ b/analyzer/python/ikos/view.py @@ -422,7 +422,7 @@ def __init__(self, file): self.call_contexts = {} self.checks = {} - def wrap(self, source, outfile): + def wrap(self, source): return self._wrap_code(source) def _wrap_code(self, source):