1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-07 07:50:32 +00:00

Import python six module only if python is 2.7

This commit is contained in:
Carles Fernandez 2020-05-10 18:15:09 +02:00
parent 0637365d6c
commit a7928bf14c
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 14 additions and 9 deletions

View File

@ -10,7 +10,8 @@
# #
from __future__ import print_function from __future__ import print_function
import sys
if sys.version_info[0] < 3:
import six import six
archs = list() archs = list()
@ -75,6 +76,7 @@ for arch_xml in archs_xml:
name = flag_xml.attributes["compiler"].value name = flag_xml.attributes["compiler"].value
if name not in flags: flags[name] = list() if name not in flags: flags[name] = list()
flags[name].append(flag_xml.firstChild.data) flags[name].append(flag_xml.firstChild.data)
if sys.version_info[0] < 3:
#force kwargs keys to be of type str, not unicode for py25 #force kwargs keys to be of type str, not unicode for py25
kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs)) kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
register_arch(flags=flags, checks=checks, **kwargs) register_arch(flags=flags, checks=checks, **kwargs)

View File

@ -8,8 +8,10 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# #
from __future__ import print_function
from __future__ import print_function
import sys
if sys.version_info[0] < 3:
import six import six
from volk_gnsssdr_arch_defs import arch_dict from volk_gnsssdr_arch_defs import arch_dict
@ -64,6 +66,7 @@ for machine_xml in machines_xml:
except: pass except: pass
kwargs['archs'] = kwargs['archs'].split() kwargs['archs'] = kwargs['archs'].split()
#force kwargs keys to be of type str, not unicode for py25 #force kwargs keys to be of type str, not unicode for py25
if sys.version_info[0] < 3:
kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs)) kwargs = dict((str(k), v) for k, v in six.iteritems(kwargs))
register_machine(**kwargs) register_machine(**kwargs)