Skip to content
Snippets Groups Projects
Commit f0167ea9 authored by dos's avatar dos Committed by dos
Browse files

simulator: Put fakes first into path

Lets the bl00mbox fake be imported in the simulator.
parent 8b113d30
No related branches found
No related tags found
No related merge requests found
...@@ -178,11 +178,11 @@ class BundleMetadata: ...@@ -178,11 +178,11 @@ class BundleMetadata:
containing_path = os.path.dirname(self.path) containing_path = os.path.dirname(self.path)
package_name = os.path.basename(self.path) package_name = os.path.basename(self.path)
if sys.path[0].endswith("python_payload"): if sys.path[1].endswith("python_payload"):
# We are in the simulator. Hack around to get this to work. # We are in the simulator. Hack around to get this to work.
prefix = "/flash/sys" prefix = "/flash/sys"
assert containing_path.startswith(prefix) assert containing_path.startswith(prefix)
containing_path = containing_path.replace(prefix, sys.path[0]) containing_path = containing_path.replace(prefix, sys.path[1])
new_sys_path = old_sys_path + [containing_path] new_sys_path = old_sys_path + [containing_path]
self._sys_path_set(new_sys_path) self._sys_path_set(new_sys_path)
......
...@@ -54,9 +54,9 @@ class UnderscoreFinder(importlib.abc.MetaPathFinder): ...@@ -54,9 +54,9 @@ class UnderscoreFinder(importlib.abc.MetaPathFinder):
# sys.meta_path.insert(0, Hook()) # sys.meta_path.insert(0, Hook())
sys.path = [ sys.path = [
os.path.join(projectpath, "sim", "fakes"),
os.path.join(projectpath, "python_payload"), os.path.join(projectpath, "python_payload"),
os.path.join(projectpath, "components", "micropython", "frozen"), os.path.join(projectpath, "components", "micropython", "frozen"),
os.path.join(projectpath, "sim", "fakes"),
] ]
builtin = BuiltinImporter() builtin = BuiltinImporter()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment