1. Eric Knibbe
  2. pygments-main

Commits

Georg Brandl  committed 750d117 Merge

Merged in roskakori/pygments-main-1/roskakori/simplified-debugging-of-endless-loops-in-1370182352684 (pull request #207)

Simplified debugging of infinite loops in lexers with random generated content

  • Participants
  • Parent commits e13fa20, 3bb61a2
  • Branches default

Comments (0)

Files changed (1)

File tests/test_basic_api.py

View file
         if cls.name in ['XQuery', 'Opa']:   # XXX temporary
             return
 
-        tokens = list(inst.get_tokens(test_content))
+        try:
+            tokens = list(inst.get_tokens(test_content))
+        except KeyboardInterrupt:
+            raise KeyboardInterrupt('interrupted %s.get_tokens(): test_content=%r' % (cls.__name__, test_content))
         txt = ""
         for token in tokens:
             assert isinstance(token, tuple)