Commit 84bc63a1 authored by Jason Swails's avatar Jason Swails
Browse files

prmtop files can have %COMMENT sections in them between the %FLAG and %FORMAT

flags. This can cause a KeyError when trying to look up the format of the
current section when it's reading the %COMMENT line (before any Format has been
assigned).
parent e5ffa905
...@@ -135,6 +135,8 @@ class PrmtopLoader(object): ...@@ -135,6 +135,8 @@ class PrmtopLoader(object):
format = format[index0+1:index1] format = format[index0+1:index1]
m = FORMAT_RE_PATTERN.search(format) m = FORMAT_RE_PATTERN.search(format)
self._raw_format[self._flags[-1]] = (format, m.group(1), m.group(2), m.group(3), m.group(4)) self._raw_format[self._flags[-1]] = (format, m.group(1), m.group(2), m.group(3), m.group(4))
elif line.startswith('%COMMENT'):
continue
elif self._flags \ elif self._flags \
and 'TITLE'==self._flags[-1] \ and 'TITLE'==self._flags[-1] \
and not self._raw_data['TITLE']: and not self._raw_data['TITLE']:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment