From 1a1d057f439643be8e65b8f17b6380f1770513f5 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Mon, 8 Apr 2024 22:30:54 -0500 Subject: [PATCH] Cast `string` var as `str`. --- src/pyobo/struct/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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