lkml.org 
[lkml]   [2018]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scripts: spdxcheck: resovle decode warning for python3
Date
From: shubhsherl <dhoni.singh094@gmail.com>

Resolve a warning issue by spdxcheck in Python3
FAIL: 'str' object has no attribute 'decode'

Signed-off-by: Shubham Singh <dhoni.singh094@gmail.com>
---
scripts/spdxcheck.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
index 839e190bbd7a..6eea4073f28a 100755
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -168,7 +168,8 @@ class id_parser(object):
self.curline = 0
try:
for line in fd:
- line = line.decode(locale.getpreferredencoding(False), errors='ignore')
+ if type(line) != str:
+ line = line.decode(locale.getpreferredencoding(False), errors='ignore')
self.curline += 1
if self.curline > maxlines:
break
--
2.18.0
\
 
 \ /
  Last update: 2018-10-01 10:40    [W:0.042 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site