diff --git a/interfaces/cython/cantera/cti2yaml.py b/interfaces/cython/cantera/cti2yaml.py index 4e0cf8416..64b8b58a4 100644 --- a/interfaces/cython/cantera/cti2yaml.py +++ b/interfaces/cython/cantera/cti2yaml.py @@ -14,7 +14,6 @@ specified. """ import sys -import os import re import pathlib from collections import OrderedDict @@ -1530,6 +1529,11 @@ def convert(filename=None, output_name=None, text=None): _reactions.clear() _reactions['reactions'] = [] + if filename is None and text is None: + raise ValueError("One of filename or text must be specified") + elif (filename is not None and text is not None): + raise ValueError("Only one of filename or text should be specified") + if filename is not None: filename = pathlib.Path(filename).expanduser() base = filename.name