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): |
102 | 102 | dst.fields = copy.copy(src.fields) |
103 | 103 | dst.nodes = copy.copy(src.nodes) |
104 | 104 | |
| 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 | |
105 | 121 | @staticmethod |
106 | 122 | def is_version(v): |
107 | 123 | for n in v.split('.'): |
… |
… |
class package(object): |
214 | 230 | prefix = default_prefix() |
215 | 231 | if prefix: |
216 | 232 | self._log('prefix: %s' % (prefix)) |
217 | | if type(prefix) is str or type(prefix) is unicode: |
| 233 | if self._is_string(prefix): |
218 | 234 | prefix = str(prefix) |
219 | 235 | self.prefix = [] |
220 | 236 | for p in prefix.split(os.pathsep): |