public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Pierre Gondois <Pierre.Gondois@arm.com>,
	sami.mujawar@arm.com, tomas.pilar@arm.com, bob.c.feng@intel.com,
	liming.gao@intel.com, nd@arm.com
Subject: [PATCH v3 4/4] BaseTools: Fix string concatenation
Date: Wed, 24 Jun 2020 10:08:37 +0100	[thread overview]
Message-ID: <20200624090837.124392-5-pierre.gondois@arm.com> (raw)
In-Reply-To: <20200624090837.124392-1-pierre.gondois@arm.com>

From: Pierre Gondois <pierre.gondois@arm.com>

Using Python 3.7.2 on win32, when printing a FileBuildRule
instance, the following error occurs:
File "edk2\BaseTools\Source\Python\AutoGen\BuildEngine.py",
line 177, in __str__
  DestString = ", ".join(self.DestFileList)
  TypeError: sequence item 0: expected str instance, PathClass found

This patch converts each PathClass element of the list to a string
instance before concatenating them.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---

The changes can be seen at https://github.com/PierreARM/edk2/commits/803_Compile_AML_bytecode_array_into_OBJ_file_v3

Notes:
    Notes:
      v2:
       - No v1 for this patch. Fix a __str__ method. [Pierre]
      v3:
      - No modification. [Pierre]

 BaseTools/Source/Python/AutoGen/BuildEngine.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py
index d602414ca41f37155c9c6d00eec54ea3918840c3..722fead75af6d60aa82365d999837cd5ac3299af 100644
--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
+++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py
@@ -172,7 +172,7 @@ class FileBuildRule:
     def __str__(self):
         SourceString = ""
         SourceString += " %s %s %s" % (self.SourceFileType, " ".join(self.SourceFileExtList), self.ExtraSourceFileList)
-        DestString = ", ".join(self.DestFileList)
+        DestString = ", ".join([str(i) for i in self.DestFileList])
         CommandString = "\n\t".join(self.CommandList)
         return "%s : %s\n\t%s" % (DestString, SourceString, CommandString)
 
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


  parent reply	other threads:[~2020-06-24  9:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24  9:08 [PATCH v3 0/4] Compile AML bytecode array into OBJ file PierreGondois
2020-06-24  9:08 ` [PATCH v3 1/4] BaseTools: Generate multiple rules when multiple output files PierreGondois
2020-06-24  9:08 ` [PATCH v3 2/4] BaseTools: Rename AmlToHex script to AmlToC PierreGondois
2020-06-24  9:08 ` [PATCH v3 3/4] BaseTools: Compile AML bytecode arrays into .obj file PierreGondois
2020-06-24  9:08 ` PierreGondois [this message]
2020-06-24 15:16 ` [edk2-devel] [PATCH v3 0/4] Compile AML bytecode array into OBJ file Bob Feng
2020-06-25  9:30   ` PierreGondois
2020-06-25 11:51     ` Bob Feng
2020-06-28  7:34     ` Bob Feng
2020-06-28 22:12       ` PierreGondois
2020-06-29 14:32       ` PierreGondois
2020-06-30 10:58         ` Bob Feng
2020-06-30 13:55           ` PierreGondois
2020-07-01  1:03             ` Bob Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200624090837.124392-5-pierre.gondois@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox