1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-04 01:03:04 +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
2 changed files with 14 additions and 9 deletions

View File

@@ -10,8 +10,9 @@
#
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__':

View File

@@ -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
@@ -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__':