diff --git a/src/pyobo/struct/utils.py b/src/pyobo/struct/utils.py index 5afc8870..21ad4137 100644 --- a/src/pyobo/struct/utils.py +++ b/src/pyobo/struct/utils.py @@ -16,12 +16,12 @@ def obo_escape(string: str) -> str: """Escape all funny characters for OBO.""" - return "".join(OBO_ESCAPE.get(character, character) for character in string) + return "".join(OBO_ESCAPE.get(character, character) for character in str(string)) def obo_escape_slim(string: str) -> str: """Escape all funny characters for OBO.""" - rv = "".join(OBO_ESCAPE_SLIM.get(character, character) for character in string) + rv = "".join(OBO_ESCAPE_SLIM.get(character, character) for character in str(string)) rv = rv.replace("\n", "\\n") return rv