Skip to content

Commit

Permalink
Sometimes alt_format seems to be a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
luciansmith committed Mar 31, 2023
1 parent 5e687d2 commit 7c0f144
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions biomodels_qc/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,19 @@ def _handle_sbf_converter_errors(filename, temp_filename, alt_filename, alt_form

if value_error is not None:
os.remove(alt_filename)
altname = alt_format
if hasattr(alt_format, 'name'):
altname = alt_format.name
raise ValueError('`{}` could not be converted to {}:\n\n {}'.format(
filename, alt_format.name, value_error.replace('\n', '\n ')))
filename, altname, value_error.replace('\n', '\n ')))

if runtime_error is not None:
os.remove(alt_filename)
altname = alt_format
if hasattr(alt_format, 'name'):
altname = alt_format.name
raise RuntimeError('`{}` could not be converted to {}:\n\n {}'.format(
filename, alt_format.name, runtime_error.replace('\n', '\n ')))
filename, altname, runtime_error.replace('\n', '\n ')))


def run_sbf_converter(filename, format):
Expand Down

0 comments on commit 7c0f144

Please sign in to comment.