@@ -385,14 +385,14 @@ def _vk_tapped(self, sender):
385385# noinspection PyAttributeOutsideInit,PyUnusedLocal,PyPep8Naming
386386class ShTerminal (ShBaseTerminal ):
387387 """
388- This is a wrapper class of the actual TextView that subclass the SUITextView.
388+ This is a wrapper class of the actual TextView that subclass the SUITextView/SUITextView_PY3 .
389389 The wrapper is used to encapsulate the objc calls so that it behaves more like
390390 a regular ui.TextView.
391391 """
392392
393393 def __init__ (self , stash , parent , superview , width , height ):
394394
395- # Create the actual TextView by subclass SUITextView
395+ # Create the actual TextView by subclass SUITextView/SUITextView_PY3
396396 UIKeyCommand = ObjCClass ('UIKeyCommand' )
397397
398398 def kcDispatcher_ (_self , _cmd , _sender ):
@@ -490,7 +490,10 @@ def keyCommands(_self, _cmd):
490490 ('UIKeyInputRightArrow' , 0 ): parent .arrowRightAction ,
491491 }
492492
493- _ShTerminal = create_objc_class ('_ShTerminal' , ObjCClass ('SUITextView' ), [keyCommands , kcDispatcher_ ])
493+ try :
494+ _ShTerminal = create_objc_class ('_ShTerminal' , ObjCClass ('SUITextView' ), [keyCommands , kcDispatcher_ ])
495+ except ValueError :
496+ _ShTerminal = create_objc_class ('_ShTerminal' , ObjCClass ('SUITextView_PY3' ), [keyCommands , kcDispatcher_ ])
494497
495498 self .is_editing = False
496499
@@ -883,7 +886,7 @@ def _build_attributed_string(self, chars):
883886
884887 def render (self , no_wait = False ):
885888 """
886- Render the screen buffer to the UITextView . Normally the rendering process
889+ Render the screen buffer to the SUITextView/SUITextView_PY3 . Normally the rendering process
887890 is delayed to throttle the total attempts of rendering.
888891 :param bool no_wait: Immediately render the screen without delay.
889892 """
0 commit comments