Edgewall Software

Changeset 1219 for trunk/genshi/input.py


Ignore:
Timestamp:
Jan 26, 2013, 6:26:47 PM (11 years ago)
Author:
hodgestar
Message:

Fix handling of processing instructions that don't have data attached (patch from Neil Muller, fixes #368).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/genshi/input.py

    r1212 r1219  
    402402
    403403    def handle_pi(self, data):
    404         target, data = data.split(None, 1)
    405404        if data.endswith('?'):
    406405            data = data[:-1]
     406        try:
     407            target, data = data.split(None, 1)
     408        except ValueError:
     409            # PI with no data
     410            target = data
     411            data = ''
    407412        self._enqueue(PI, (target.strip(), data.strip()))
    408413
Note: See TracChangeset for help on using the changeset viewer.