From f0275761931d976835da636eac16755b97f239f9 Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Wed, 14 Nov 2018 17:46:03 +0800 Subject: 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 Signed-off-by: Richard Purdie --- scripts/oepydevshell-internal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/oepydevshell-internal.py') 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: (ready, _, _) = select.select([pty, sys.stdin], writers , [], 0) try: if pty in ready: - i = i + pty.read().decode('utf-8') + readdata = pty.read() + if readdata: + i = i + readdata.decode('utf-8') if i: # Write a page at a time to avoid overflowing output # d.keys() is a good way to do that -- cgit v1.2.3-54-g00ecf