Skip to contentSkip to conversation

utils: Fix mkdir with PosixPath

PATCH New Richard Purdie 1 participant 1 message Dec 17, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils: Fix mkdir with PosixPath

Avoid:
Exception: AttributeError: 'PosixPath' object has no attribute 'find'

---
 lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/utils.py +1 -1
index d299b2efdb..52a136f809 100644
@@ -759,7 +759,7 @@ def mkdirhier(directory):
     """Create a directory like 'mkdir -p', but does not complain if
     directory already exists like os.makedirs
     """
-    if directory.find('${') != -1:
+    if '${' in directory:
         bb.fatal("Directory name {} contains unexpanded bitbake variable. This may cause build failures and WORKDIR polution.".format(directory))
     try:
         os.makedirs(directory)
Signature · 1 line
2.39.2