dijxtra / simplepyged

A simple Python GEDCOM parser
GNU General Public License v3.0
39 stars 19 forks source link

Don't throw Exception if no last name #3

Closed frewsxcv closed 10 years ago

frewsxcv commented 11 years ago

Quite a few of my datasets have occurrences where individuals don't have last names. Attempting to get their name results in:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "simplepyged/records.py", line 261, in name
    last = string.strip(name[1])
IndexError: list index out of range

This pull-request change would result in:

>>> my_individual.name()  # person with no last name
('Barack Hussein', None)
dijxtra commented 10 years ago

Cool, thanks for fixing that.