summaryrefslogtreecommitdiff
path: root/obsapi/helpers.py
diff options
context:
space:
mode:
authorScott Bahling <sbahling@suse.com>2020-02-07 00:24:38 +0100
committerScott Bahling <sbahling@suse.com>2020-02-07 00:24:38 +0100
commitbf747ab6a5a8d8bf9384408e8ffb299f0735c554 (patch)
tree0092c9b0dcc10e8d9f90a3f93249ff982fd292bf /obsapi/helpers.py
parente566c85a508562a5ebc88e13e2d5571b78eef045 (diff)
downloadobsapi-bf747ab6a5a8d8bf9384408e8ffb299f0735c554.tar.gz
obsapi-bf747ab6a5a8d8bf9384408e8ffb299f0735c554.tar.xz
obsapi-bf747ab6a5a8d8bf9384408e8ffb299f0735c554.zip
Add get_package_source_version()
Diffstat (limited to 'obsapi/helpers.py')
-rw-r--r--obsapi/helpers.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/obsapi/helpers.py b/obsapi/helpers.py
index 6912035..be20a31 100644
--- a/obsapi/helpers.py
+++ b/obsapi/helpers.py
@@ -21,3 +21,10 @@ def xml2etree(xml):
return etree.parse(BytesIO(xml), parser).xpath('.')[0]
except Exception as e:
raise e
+
+
+def as_string(obj):
+ if isinstance(obj, bytes):
+ return obj.decode('utf-8')
+ else:
+ return str(obj)