Skip to content

Commit

Permalink
Make compatible with Pygments >= 2.12 (#264).
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ivanperez-keera committed Apr 1, 2024
1 parent fcca375 commit 55998a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions analyzer/python/ikos/highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion analyzer/python/ikos/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 55998a9

Please sign in to comment.