File tree Expand file tree Collapse file tree
src/com/dtmilano/android/adb Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818'''
1919import threading
2020
21- __version__ = '11.5.9 '
21+ __version__ = '11.5.10 '
2222
2323import sys
2424import warnings
@@ -691,13 +691,16 @@ def takeSnapshot(self, reconnect=False):
691691 else :
692692 # ALTERNATIVE_METHOD: screencap
693693 received = self .shell ('/system/bin/screencap -p' ).replace ("\r \n " , "\n " )
694+ if not received :
695+ raise RuntimeError ('"/system/bin/screencap -p" result was empty' )
694696 stream = StringIO .StringIO (received )
695697 try :
696698 image = Image .open (stream )
697699 except IOError , ex :
698700 print >> sys .stderr , ex
699- print repr (stream )
700- sys .exit (1 )
701+ print >> sys .stderr , repr (stream )
702+ print >> sys .stderr , repr (received )
703+ raise RuntimeError ('Cannot convert stream to image: ' + ex )
701704
702705 # Just in case let's get the real image size
703706 (w , h ) = image .size
You can’t perform that action at this time.
0 commit comments