<gh_stars>0
# -*- coding: utf-8 -*-

"""
#=============================================================================
#  ProjectName: plum-tools
#     FileName: compat
#         Desc: 兼容Python2/Python3
#       Author: seekplum
#        Email: <EMAIL>
#     HomePage: seekplum.github.io
#       Create: 2019-04-04 20:16
#=============================================================================
"""

import sys

PY2 = sys.version_info[0] == 2
if PY2:  # pragma: no cover
    exec(
        """def implements_to_unicode(cls):
        if isinstance(cls, unicode):
            return cls

        if isinstance(cls, str):
            cls = cls.decode('utf-8')
        else:
            cls = implements_to_unicode("%s" % cls)
        return cls"""
    )

else:

    def implements_to_unicode(cls):
        """转换编码为unicode"""
        return "%s" % cls

# -*- coding: utf-8 -*-

"""
#=============================================================================
#  ProjectName: plum-tools
#     FileName: compat
#         Desc: 兼容Python2/Python3
#       Author: seekplum
#        Email: <EMAIL>
#     HomePage: seekplum.github.io
#       Create: 2019-04-04 20:16
#=============================================================================
"""

import sys

PY2 = sys.version_info[0] == 2
if PY2:  # pragma: no cover
    exec(
        """def implements_to_unicode(cls):
        if isinstance(cls, unicode):
            return cls

        if isinstance(cls, str):
            cls = cls.decode('utf-8')
        else:
            cls = implements_to_unicode("%s" % cls)
        return cls"""
    )

else:

    def implements_to_unicode(cls):
        """转换编码为unicode"""
        return "%s" % cls
# -*- coding: utf-8 -*- #============================================================================= #  ProjectName: plum-tools #     FileName: compat #         Desc: 兼容Python2/Python3 #       Author: seekplum #        Email: <EMAIL> #     HomePage: seekplum.github.io #       Create: 2019-04-04 20:16 #============================================================================= # pragma: no cover def implements_to_unicode(cls):         if isinstance(cls, unicode):             return cls          if isinstance(cls, str):             cls = cls.decode('utf-8')         else:             cls = implements_to_unicode("%s" % cls)         return cls 转换编码为unicode