diff options
| author | Scott Bahling <sbahling@suse.com> | 2020-02-07 00:24:38 +0100 |
|---|---|---|
| committer | Scott Bahling <sbahling@suse.com> | 2020-02-07 00:24:38 +0100 |
| commit | bf747ab6a5a8d8bf9384408e8ffb299f0735c554 (patch) | |
| tree | 0092c9b0dcc10e8d9f90a3f93249ff982fd292bf /obsapi/helpers.py | |
| parent | e566c85a508562a5ebc88e13e2d5571b78eef045 (diff) | |
| download | obsapi-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.py | 7 |
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) |
