From: Paul Burton Date: Mon, 26 Sep 2016 15:30:35 +0100 Subject: [U-Boot] [PATCH 9/9] dtoc: Make integer division python 3.x safe In-Reply-To: <20160926143036.5746-1-paul.burton@imgtec.com> References: <20160926143036.5746-1-paul.burton@imgtec.com> Message-ID: <20160926143036.5746-10-paul.burton@imgtec.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de If we use the '/' operator then python 3.x will produce a float, and refuse to multiply the string sequence in Conv_name_to_c by it with: TypeError: can't multiply sequence by non-int of type 'float' Use the '//' operator instead to enforce that we want integer rather than floating point division. Signed-off-by: Paul Burton --- tools/dtoc/dtoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/dtoc.py index 4ba8604..ac7ba6c 100755 --- a/tools/dtoc/dtoc.py +++ b/tools/dtoc/dtoc.py @@ -60,7 +60,7 @@ def Conv_name_to_c(name): def TabTo(num_tabs, str): if len(str) >= num_tabs * 8: return str + ' ' - return str + '\t' * (num_tabs - len(str) / 8) + return str + '\t' * (num_tabs - len(str) // 8) class DtbPlatdata: """Provide a means to convert device tree binary data to platform data -- 2.10.0