[oe-commits] [openembedded-core] 05/18: oepydevshell-internal.py: decode only when readdata is valid

git at git.openembedded.org git at git.openembedded.org
Fri Nov 16 10:30:24 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit d598f8d48e9b094af99effa7471d613b16ffa817
Author: Changqing Li <changqing.li at windriver.com>
AuthorDate: Wed Nov 14 17:46:03 2018 +0800

    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]
    
    Signed-off-by: Changqing Li <changqing.li at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/oepydevshell-internal.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/oepydevshell-internal.py b/scripts/oepydevshell-internal.py
index 04621ae..2f7d5d4 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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list