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:
		@@ -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__':
 | 
			
		||||
 
 | 
			
		||||
@@ -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__':
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user