edsu/pymarc — pull request #32 by rlmv (2013-02-11 08:31:34+00:00)
Title: Fix AttributeError caused by controlfield iteration

This is a quick fix for a bug I just ran into. If you try and iterate over a controlfield, like so
```
controlfield = Field('008'')

for subfield in controlfield:
...do stuff...
```
an AttributeError gets thrown, since `next()` tries to access `self.subfields` which is not set in `__init__`. This will show up anytime `get_subfield` is called on a controlfield, so I added an attribute check in the `next` method to catch this before it happens. There's a test case in here as well to make sure everything checks out.