Skip to content

Fix bug in parse_formula for formula's with leading or trailing whitespace#2186

Merged
sphuber merged 1 commit into
aiidateam:developfrom
sphuber:fix_2185_cif_data_parse_formula
Nov 11, 2018
Merged

Fix bug in parse_formula for formula's with leading or trailing whitespace#2186
sphuber merged 1 commit into
aiidateam:developfrom
sphuber:fix_2185_cif_data_parse_formula

Conversation

@sphuber
Copy link
Copy Markdown
Contributor

@sphuber sphuber commented Nov 11, 2018

FIxes #2185

If a formula contains leading or trailing whitespace, one of the parts over
which the function loops will be empty, and so the regex match m will be
None. To prevent an AttributeError from being thrown when group is
called on None we check for it and continue.

…tespace

If a formula contains leading or trailing whitespace, one of the parts over
which the function loops will be empty, and so the regex match `m` will be
`None`. To prevent an `AttributeError` from being thrown when `group` is
called on `None` we check for it and continue.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.03%) to 68.597% when pulling ee9bc19 on sphuber:fix_2185_cif_data_parse_formula into 5a8438d on aiidateam:develop.

@sphuber sphuber merged commit eec38d8 into aiidateam:develop Nov 11, 2018
@sphuber sphuber deleted the fix_2185_cif_data_parse_formula branch November 11, 2018 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants