Commit 34c38896357db4aae266b14346927da2cd920de6
Committed by
sjg
1 parent
c4c5f9eefb
Exists in
v2017.01-smarct4x
and in
25 other branches
dtoc: Make integer division python 3.x safe
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 <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
tools/dtoc/dtoc.py
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 | def TabTo(num_tabs, str): |
61 | 61 | if len(str) >= num_tabs * 8: |
62 | 62 | return str + ' ' |
63 | - return str + '\t' * (num_tabs - len(str) / 8) | |
63 | + return str + '\t' * (num_tabs - len(str) // 8) | |
64 | 64 | |
65 | 65 | class DtbPlatdata: |
66 | 66 | """Provide a means to convert device tree binary data to platform data |