From 2771c158437c74db9026a5896eed0e9ddde70d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Mon, 9 Mar 2020 18:04:59 +0100 Subject: [PATCH] Update for newest pygments release string_types and iteritems, which are for python2 compatibility, got removed --- gitsrht/annotations.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gitsrht/annotations.py b/gitsrht/annotations.py index d8a6f12..0420bcf 100644 --- a/gitsrht/annotations.py +++ b/gitsrht/annotations.py @@ -1,6 +1,5 @@ from pygments.formatter import Formatter from pygments.token import Token, STANDARD_TYPES -from pygments.util import string_types, iteritems from srht.markdown import markdown from urllib.parse import urlparse @@ -43,7 +42,7 @@ class _BaseFormatter(Formatter): """ if arg is None: arg = ".highlight" - if isinstance(arg, string_types): + if isinstance(arg, str): args = [arg] else: args = list(arg) @@ -57,7 +56,7 @@ class _BaseFormatter(Formatter): return ', '.join(tmp) styles = [(level, ttype, cls, style) - for cls, (style, ttype, level) in iteritems(self.class2style) + for cls, (style, ttype, level) in self.class2style.items() if cls and style] styles.sort() lines = ['%s { %s } /* %s */' % (prefix(cls), style, repr(ttype)[6:]) -- 2.38.4