Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

Ticket #4094: 0001-pkgconfig.py-Removed-use-of-unicode-keyword-for-pyth.patch

File 0001-pkgconfig.py-Removed-use-of-unicode-keyword-for-pyth.patch, 1.5 KB (added by Stephen Clark, on 09/25/20 at 21:47:24)

Patch for 5 branch

  • source-builder/sb/pkgconfig.py

    From b2f7c196685caf38f63868a40fbe7453c218239e Mon Sep 17 00:00:00 2001
    From: Stephen Clark <stephen.clark@oarcorp.com>
    Date: Wed, 23 Sep 2020 16:00:55 -0500
    Subject: [PATCH] pkgconfig.py: Removed use of "unicode" keyword for python3
     compatibility
    
    Closes #4094.
    ---
     source-builder/sb/pkgconfig.py | 18 +++++++++++++++++-
     1 file changed, 17 insertions(+), 1 deletion(-)
    
    diff --git a/source-builder/sb/pkgconfig.py b/source-builder/sb/pkgconfig.py
    index 99646f7..afc259b 100755
    a b class package(object): 
    102102        dst.fields = copy.copy(src.fields)
    103103        dst.nodes = copy.copy(src.nodes)
    104104
     105    @staticmethod
     106    def _is_string(us):
     107        if type(us) == str:
     108            return True
     109        try:
     110            if type(us) == unicode:
     111                return True
     112        except:
     113            pass
     114        try:
     115            if type(us) == bytes:
     116                return True
     117        except:
     118            pass
     119        return False
     120
    105121    @staticmethod
    106122    def is_version(v):
    107123        for n in v.split('.'):
    class package(object): 
    214230            prefix = default_prefix()
    215231        if prefix:
    216232            self._log('prefix: %s' % (prefix))
    217             if type(prefix) is str or type(prefix) is unicode:
     233            if self._is_string(prefix):
    218234                prefix = str(prefix)
    219235                self.prefix = []
    220236                for p in prefix.split(os.pathsep):