(val)
return val
On Python 2, much of distutils relies on string values being of
        type 'str' (bytes) and not unicode text. If the value can be safely
        encoded to bytes using the default encoding, prefer that.

        Why the default encoding? Because that value can be implicitly
        decoded back to text if needed.

        Ref #1653
On Python 2, much of distutils relies on string values being of
        type 'str' (bytes) and not unicode text. If the value can be safely
        encoded to bytes using the default encoding, prefer that.
On Python 2 much of distutils relies on string values being of type str ( bytes ) and not unicode text . If the value can be safely encoded to bytes using the default encoding prefer that .
def _try_str(val):
        """
        On Python 2, much of distutils relies on string values being of
        type 'str' (bytes) and not unicode text. If the value can be safely
        encoded to bytes using the default encoding, prefer that.

        Why the default encoding? Because that value can be implicitly
        decoded back to text if needed.

        Ref #1653
        """
        if six.PY3:
            return val
        try:
            return val.encode()
        except UnicodeEncodeError:
            pass
        return val
def _try_str ( val ) : if six . PY3 : return val try : return val . encode ( ) except UnicodeEncodeError : pass return val