aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/_code/source.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/_pytest/_code/source.py b/_pytest/_code/source.py
index a1521f8a21..8bb3e45825 100644
--- a/_pytest/_code/source.py
+++ b/_pytest/_code/source.py
@@ -416,6 +416,8 @@ def getstatementrange_old(lineno, source, assertion=False):
trysource = source[start:end]
if trysource.isparseable():
return start, end
+ if end == start + 100: # XXX otherwise, it takes forever
+ break # XXX
raise SyntaxError("no valid source range around line %d " % (lineno,))