Edgewall Software

Ticket #370: match_with_if

File match_with_if, 659 bytes (added by Felix Schwarz <felix.schwarz@…>, 14 years ago)

preliminary patch

Line 
1diff -r 4d3bcc77235b genshi/path.py
2--- a/genshi/path.py    Thu Feb 18 09:17:45 2010 +0000
3+++ b/genshi/path.py    Fri Feb 19 17:24:39 2010 +0100
4@@ -125,8 +125,11 @@
5                     or kind is START_CDATA or kind is END_CDATA:
6                 # should we make namespaces work?
7                 return None
8-
9-            pos_queue = deque([(pos, cou, []) for pos, cou in stack[-1]])
10+           
11+            if len(stack) > 0:
12+                pos_queue = deque([(pos, cou, []) for pos, cou in stack[-1]])
13+            else:
14+                pos_queue = None
15             next_pos = []
16 
17             # length of real part of path - we omit attribute axis