forked from platformio/platformio-core
Handle possible NodeList in source files when processing Middlewares // Resolve #3531
env.Object() returns a list of objects that breaks the processing of subsequent middlewares since we only expected File nodes.
This commit is contained in:
1 parent
cb70e51016
commit
df0e6016bb
2 files changed
+4
No files matched your search
@@ -20,6 +20,7 @@ import sys
|
||||
|
||||
from SCons import Builder, Util # pylint: disable=import-error
|
||||
from SCons.Node import FS # pylint: disable=import-error
|
||||
from SCons.Node import NodeList # pylint: disable=import-error
|
||||
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
|
||||
from SCons.Script import AlwaysBuild # pylint: disable=import-error
|
||||
from SCons.Script import DefaultEnvironment # pylint: disable=import-error
|
||||
@@ -285,6 +286,8 @@ def CollectBuildFiles(
|
||||
for callback, pattern in env.get("__PIO_BUILD_MIDDLEWARES", []):
|
||||
tmp = []
|
||||
for node in sources:
|
||||
if isinstance(node, NodeList):
|
||||
node = node[0]
|
||||
if pattern and not fnmatch.fnmatch(node.srcnode().get_path(), pattern):
|
||||
tmp.append(node)
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user