From 8136e0906ea51d951e1e0d651f31633a7a84ad1a Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Sat, 19 Apr 2014 18:14:01 +0200 Subject: [PATCH] Fix use of range as list. --- pubs/bibstruct.py | 3 ++- tests/test_color.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pubs/bibstruct.py b/pubs/bibstruct.py index c8f942a..ee98b10 100644 --- a/pubs/bibstruct.py +++ b/pubs/bibstruct.py @@ -5,7 +5,8 @@ from .p3 import ustr, unichr # citekey stuff -CONTROL_CHARS = ''.join(map(unichr, range(0, 32) + range(127, 160))) +CONTROL_CHARS = ''.join(map(unichr, + list(range(0, 32)) + list(range(127, 160)))) CITEKEY_FORBIDDEN_CHARS = '@\'\\,#}{~%/' # '/' is OK for bibtex but forbidden # here since we transform citekeys into filenames CITEKEY_EXCLUDE_RE = re.compile('[%s]' diff --git a/tests/test_color.py b/tests/test_color.py index 58ba672..0590ecf 100644 --- a/tests/test_color.py +++ b/tests/test_color.py @@ -1,10 +1,12 @@ import dotdot from pubs import color + def perf_color(): - s = str(range(1000)) + s = str(list(range(1000))) for _ in range(5000000): color.dye(s, color.red) + if __name__ == '__main__': perf_color()