mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Merge pull request #7092 from cmonr/py3-in-windows
Additional fixes for running Python 3 in Windowspull/7111/head
						commit
						80dde0b953
					
				| 
						 | 
				
			
			@ -458,8 +458,7 @@ def merge_region_list(region_list, destination, notify, padding=b'\xFF'):
 | 
			
		|||
        makedirs(dirname(destination))
 | 
			
		||||
    notify.info("Space used after regions merged: 0x%x" %
 | 
			
		||||
                (merged.maxaddr() - merged.minaddr() + 1))
 | 
			
		||||
    with open(destination, "wb+") as output:
 | 
			
		||||
        merged.tofile(output, format=format.strip("."))
 | 
			
		||||
    merged.tofile(destination, format=format.strip("."))
 | 
			
		||||
 | 
			
		||||
def scan_resources(src_paths, toolchain, dependencies_paths=None,
 | 
			
		||||
                   inc_dirs=None, base_path=None, collect_ignores=False):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ class _Parser(object):
 | 
			
		|||
 | 
			
		||||
class _GccParser(_Parser):
 | 
			
		||||
    RE_OBJECT_FILE = re.compile(r'^(.+\/.+\.o)$')
 | 
			
		||||
    RE_LIBRARY_OBJECT = re.compile(r'^.+' + sep + r'lib((.+\.a)\((.+\.o)\))$')
 | 
			
		||||
    RE_LIBRARY_OBJECT = re.compile(r'^.+' + r''.format(sep) + r'lib((.+\.a)\((.+\.o)\))$')
 | 
			
		||||
    RE_STD_SECTION = re.compile(r'^\s+.*0x(\w{8,16})\s+0x(\w+)\s(.+)$')
 | 
			
		||||
    RE_FILL_SECTION = re.compile(r'^\s*\*fill\*\s+0x(\w{8,16})\s+0x(\w+).*$')
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,6 +14,7 @@
 | 
			
		|||
# limitations under the License.
 | 
			
		||||
 | 
			
		||||
from __future__ import print_function, division, absolute_import
 | 
			
		||||
from past.builtins import basestring
 | 
			
		||||
 | 
			
		||||
import re
 | 
			
		||||
import sys
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,7 +10,6 @@ import os.path
 | 
			
		|||
import sys
 | 
			
		||||
import subprocess
 | 
			
		||||
from shutil import rmtree
 | 
			
		||||
from sets import Set
 | 
			
		||||
 | 
			
		||||
ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
 | 
			
		||||
sys.path.insert(0, ROOT)
 | 
			
		||||
| 
						 | 
				
			
			@ -254,11 +253,11 @@ def export_repos(config, ides, targets, examples):
 | 
			
		|||
            ides - List of IDES to export to
 | 
			
		||||
    """
 | 
			
		||||
    results = {}
 | 
			
		||||
    valid_examples = Set(examples)
 | 
			
		||||
    valid_examples = set(examples)
 | 
			
		||||
    print("\nExporting example repos....\n")
 | 
			
		||||
    for example in config['examples']:
 | 
			
		||||
        example_names = [basename(x['repo']) for x in get_repo_list(example)]
 | 
			
		||||
        common_examples = valid_examples.intersection(Set(example_names))
 | 
			
		||||
        common_examples = valid_examples.intersection(set(example_names))
 | 
			
		||||
        if not common_examples:
 | 
			
		||||
            continue
 | 
			
		||||
        export_failures = []
 | 
			
		||||
| 
						 | 
				
			
			@ -337,11 +336,11 @@ def compile_repos(config, toolchains, targets, profile, examples):
 | 
			
		|||
 | 
			
		||||
    """
 | 
			
		||||
    results = {}
 | 
			
		||||
    valid_examples = Set(examples)
 | 
			
		||||
    valid_examples = set(examples)
 | 
			
		||||
    print("\nCompiling example repos....\n")
 | 
			
		||||
    for example in config['examples']:
 | 
			
		||||
        example_names = [basename(x['repo']) for x in get_repo_list(example)]
 | 
			
		||||
        common_examples = valid_examples.intersection(Set(example_names))
 | 
			
		||||
        common_examples = valid_examples.intersection(set(example_names))
 | 
			
		||||
        if not common_examples:
 | 
			
		||||
            continue
 | 
			
		||||
        failures = []
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,8 +64,6 @@ def test_parse_gcc():
 | 
			
		|||
        parsed_data_os_agnostic[k.replace('/', sep)] = PARSED_GCC_DATA[k]
 | 
			
		||||
 | 
			
		||||
    assert memap.modules == parsed_data_os_agnostic
 | 
			
		||||
    memap.parse(join(dirname(__file__), "gcc.map"), "GCC_CR")
 | 
			
		||||
    assert memap.modules == parsed_data_os_agnostic
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_add_empty_module():
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,7 +45,7 @@ from ..memap import MemapParser
 | 
			
		|||
CPU_COUNT_MIN = 1
 | 
			
		||||
CPU_COEF = 1
 | 
			
		||||
 | 
			
		||||
class LazyDict(dict):
 | 
			
		||||
class LazyDict(object):
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        self.eager = {}
 | 
			
		||||
        self.lazy = {}
 | 
			
		||||
| 
						 | 
				
			
			@ -252,8 +252,6 @@ class Resources:
 | 
			
		|||
            headername = basename(filename)
 | 
			
		||||
            dupe_headers.setdefault(headername, set())
 | 
			
		||||
            dupe_headers[headername] |= set([headername])
 | 
			
		||||
        for res in self.features.values():
 | 
			
		||||
            res._collect_duplicates(dupe_dict, dupe_headers)
 | 
			
		||||
        return dupe_dict, dupe_headers
 | 
			
		||||
 | 
			
		||||
    def detect_duplicates(self, toolchain):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue