mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Import python six module only if python is 2.7
This commit is contained in:
parent
0637365d6c
commit
a7928bf14c
@ -10,9 +10,10 @@
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import six
|
||||
|
||||
import sys
|
||||
if sys.version_info[0] < 3:
|
||||
import six
|
||||
|
||||
archs = list()
|
||||
arch_dict = dict()
|
||||
|
||||
@ -75,8 +76,9 @@ for arch_xml in archs_xml:
|
||||
name = flag_xml.attributes["compiler"].value
|
||||
if name not in flags: flags[name] = list()
|
||||
flags[name].append(flag_xml.firstChild.data)
|
||||
#force kwargs keys to be of type str, not unicode for py25
|
||||
kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
|
||||
if sys.version_info[0] < 3:
|
||||
#force kwargs keys to be of type str, not unicode for py25
|
||||
kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
|
||||
register_arch(flags=flags, checks=checks, **kwargs)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -8,9 +8,11 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
from __future__ import print_function
|
||||
|
||||
import six
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
if sys.version_info[0] < 3:
|
||||
import six
|
||||
|
||||
from volk_gnsssdr_arch_defs import arch_dict
|
||||
|
||||
@ -28,7 +30,7 @@ class machine_class(object):
|
||||
self.archs.append(arch)
|
||||
self.arch_names.append(arch_name)
|
||||
self.alignment = max([a.alignment for a in self.archs])
|
||||
|
||||
|
||||
def __repr__(self): return self.name
|
||||
|
||||
def register_machine(name, archs):
|
||||
@ -64,7 +66,8 @@ for machine_xml in machines_xml:
|
||||
except: pass
|
||||
kwargs['archs'] = kwargs['archs'].split()
|
||||
#force kwargs keys to be of type str, not unicode for py25
|
||||
kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
|
||||
if sys.version_info[0] < 3:
|
||||
kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
|
||||
register_machine(**kwargs)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user