+# compat: remove force_unicode & force_bytes when pyelftools<=0.23 support is
+# dropped.
+def force_unicode(s):
+ if hasattr(s, 'decode') and callable(s.decode):
+ s = s.decode('latin-1') # same encoding used in pyelftools py3compat
+ return s
+
+
+def force_bytes(s):
+ if hasattr(s, 'encode') and callable(s.encode):
+ s = s.encode('latin-1') # same encoding used in pyelftools py3compat
+ return s
+
+