summaryrefslogtreecommitdiffstats
path: root/scripts/oepydevshell-internal.py
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2018-11-14 17:46:03 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-16 11:46:07 +0000
commitf0275761931d976835da636eac16755b97f239f9 (patch)
tree64ed2d643a9d23f82bd597158b2f423d58712b66 /scripts/oepydevshell-internal.py
parent10270f42220cec579d0875ce1739261c682a6dc4 (diff)
downloadpoky-f0275761931d976835da636eac16755b97f239f9.tar.gz
oepydevshell-internal.py: decode only when readdata is valid
fix below problem: pydevshell raises exception when maximize the python shell window. when click maximize, rlist of select return ready object, but the pty.read is None, so throw exception of 'NoneType' object has no attribute 'decode', change to only decode when readdata is valid. [YOCTO #11875] (From OE-Core rev: d598f8d48e9b094af99effa7471d613b16ffa817) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oepydevshell-internal.py')
-rwxr-xr-xscripts/oepydevshell-internal.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/oepydevshell-internal.py b/scripts/oepydevshell-internal.py
index 04621ae8a1..2f7d5d433e 100755
--- a/scripts/oepydevshell-internal.py
+++ b/scripts/oepydevshell-internal.py
@@ -63,7 +63,9 @@ try:
63 (ready, _, _) = select.select([pty, sys.stdin], writers , [], 0) 63 (ready, _, _) = select.select([pty, sys.stdin], writers , [], 0)
64 try: 64 try:
65 if pty in ready: 65 if pty in ready:
66 i = i + pty.read().decode('utf-8') 66 readdata = pty.read()
67 if readdata:
68 i = i + readdata.decode('utf-8')
67 if i: 69 if i:
68 # Write a page at a time to avoid overflowing output 70 # Write a page at a time to avoid overflowing output
69 # d.keys() is a good way to do that 71 # d.keys() is a good way to do that