mirror of
git://git.yoctoproject.org/poky
synced 2026-09-27 10:18:57 +00:00
base: Don't add duplicates to sys.path
We can re-trigger this code and there is little point in stacking a ton of duplicate paths which just waste time during searches for modules. This could in theory alter layer module search order but that seems unlikely in common use. (From OE-Core rev: dadce8468db1c0fd0e04801cdc6cf287c2808477) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
ee5f9d9fdd
commit
61c7c8f175
@ -20,8 +20,8 @@ PACKAGECONFIG_CONFARGS ??= ""
|
|||||||
def oe_import(d):
|
def oe_import(d):
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
bbpath = d.getVar("BBPATH").split(":")
|
bbpath = [os.path.join(dir, "lib") for dir in d.getVar("BBPATH").split(":")]
|
||||||
sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
|
sys.path[0:0] = [dir for dir in bbpath if dir not in sys.path]
|
||||||
|
|
||||||
def inject(name, value):
|
def inject(name, value):
|
||||||
"""Make a python object accessible from the metadata"""
|
"""Make a python object accessible from the metadata"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user