summaryrefslogtreecommitdiff
path: root/scripts/vim2pygments.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-01-18 16:44:49 +0100
committerGeorg Brandl <georg@python.org>2014-01-18 16:44:49 +0100
commit97703d63f39e6086d497a6a749c9eee3293dcbeb (patch)
treec970bf2a7bc17aa7053f3621e299a01fb9695342 /scripts/vim2pygments.py
parent5500fd3a6d0c5ece01826606fcf2d684407b9cc6 (diff)
downloadpygments-97703d63f39e6086d497a6a749c9eee3293dcbeb.tar.gz
Finalize single-source port for Py2.[67] and Py3.3+.
Diffstat (limited to 'scripts/vim2pygments.py')
-rwxr-xr-xscripts/vim2pygments.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/vim2pygments.py b/scripts/vim2pygments.py
index 348fb852..42af0bbe 100755
--- a/scripts/vim2pygments.py
+++ b/scripts/vim2pygments.py
@@ -16,7 +16,7 @@ from __future__ import print_function
import sys
import re
from os import path
-from cStringIO import StringIO
+from io import StringIO
split_re = re.compile(r'(?<!\\)\s+')
@@ -767,7 +767,7 @@ TOKENS = {
}
TOKEN_TYPES = set()
-for token in TOKENS.itervalues():
+for token in TOKENS.values():
if not isinstance(token, tuple):
token = (token,)
for token in token:
@@ -838,7 +838,7 @@ def find_colors(code):
colors['Normal']['bgcolor'] = bg_color
color_map = {}
- for token, styles in colors.iteritems():
+ for token, styles in colors.items():
if token in TOKENS:
tmp = []
if styles.get('noinherit'):
@@ -881,7 +881,7 @@ class StyleWriter(object):
def write(self, out):
self.write_header(out)
default_token, tokens = find_colors(self.code)
- tokens = tokens.items()
+ tokens = list(tokens.items())
tokens.sort(lambda a, b: cmp(len(a[0]), len(a[1])))
bg_color = [x[3:] for x in default_token.split() if x.startswith('bg:')]
if bg_color: