mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
pkgconfig.py: Removed use of "unicode" keyword for python3 compatibility
Closes #4094.
This commit is contained in:
parent
1ea1c9cdc5
commit
ed5030bc24
@ -102,6 +102,22 @@ class package(object):
|
||||
dst.fields = copy.copy(src.fields)
|
||||
dst.nodes = copy.copy(src.nodes)
|
||||
|
||||
@staticmethod
|
||||
def _is_string(us):
|
||||
if type(us) == str:
|
||||
return True
|
||||
try:
|
||||
if type(us) == unicode:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if type(us) == bytes:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def is_version(v):
|
||||
for n in v.split('.'):
|
||||
@ -214,12 +230,7 @@ class package(object):
|
||||
prefix = default_prefix()
|
||||
if prefix:
|
||||
self._log('prefix: %s' % (prefix))
|
||||
try:
|
||||
if type(prefix) is unicode:
|
||||
prefix = prefix.decode("utf-8", "ignore")
|
||||
except:
|
||||
pass
|
||||
if type(prefix) is str:
|
||||
if self._is_string(prefix):
|
||||
prefix = str(prefix)
|
||||
self.prefix = []
|
||||
for p in prefix.split(os.pathsep):
|
||||
|
Loading…
x
Reference in New Issue
Block a user