diff options
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) |
