From 122c870312666a13809d3ad94db2501b0c342d77 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 11 Jan 2022 13:41:26 +0200 Subject: [PATCH] Replace _string with str --- src/pylast/__init__.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/pylast/__init__.py b/src/pylast/__init__.py index 910f847..3f00b5a 100644 --- a/src/pylast/__init__.py +++ b/src/pylast/__init__.py @@ -1101,7 +1101,7 @@ Image = collections.namedtuple( def _string_output(func): def r(*args): - return _string(func(*args)) + return str(func(*args)) return r @@ -2730,12 +2730,6 @@ def _unicode(text): return str(text) -def _string(string): - if isinstance(string, str): - return string - return str(string) - - def cleanup_nodes(doc): """ Remove text nodes containing only whitespace @@ -2881,7 +2875,7 @@ def _extract_tracks(doc, network): def _url_safe(text): """Does all kinds of tricks on a text to make it safe to use in a URL.""" - return quote_plus(quote_plus(_string(text))).lower() + return quote_plus(quote_plus(str(text))).lower() def _number(string): @@ -2908,7 +2902,7 @@ def _unescape_htmlentity(string): def _parse_response(response: str) -> xml.dom.minidom.Document: - response = _string(response).replace("opensearch:", "") + response = str(response).replace("opensearch:", "") try: doc = minidom.parseString(response) except xml.parsers.expat.ExpatError: