5656
5757logger = logging .getLogger (__name__ )
5858
59- INCONSISTENT_HISTORY_MSG = u "#<---History inconsistent with output shown--->"
60- CONTIGUITY_BROKEN_MSG = u "#<---History contiguity broken by rewind--->"
61- HELP_MESSAGE = u """
59+ INCONSISTENT_HISTORY_MSG = "#<---History inconsistent with output shown--->"
60+ CONTIGUITY_BROKEN_MSG = "#<---History contiguity broken by rewind--->"
61+ HELP_MESSAGE = """
6262Thanks for using bpython!
6363
6464See http://bpython-interpreter.org/ for more information and
@@ -771,7 +771,7 @@ def down_one_line(self):
771771
772772 def process_simple_keypress (self , e ):
773773 # '\n' needed for pastes
774- if e in (u "<Ctrl-j>" , u "<Ctrl-m>" , u "<PADENTER>" , u "\n " , u "\r " ):
774+ if e in ("<Ctrl-j>" , "<Ctrl-m>" , "<PADENTER>" , "\n " , "\r " ):
775775 self .on_enter ()
776776 while self .fake_refresh_requested :
777777 self .fake_refresh_requested = False
@@ -796,14 +796,14 @@ def send_current_block_to_external_editor(self, filename=None):
796796 self .cursor_offset = len (self .current_line )
797797
798798 def send_session_to_external_editor (self , filename = None ):
799- for_editor = (u "### current bpython session - file will be "
800- u "reevaluated, ### lines will not be run\n " )
801- for_editor += u '\n ' .join (line [len (self .ps1 ):]
802- if line .startswith (self .ps1 ) else
803- line [len (self .ps2 ):]
804- if line .startswith (self .ps2 ) else
805- '### ' + line
806- for line in self .getstdout ().split ('\n ' ))
799+ for_editor = ("### current bpython session - file will be "
800+ "reevaluated, ### lines will not be run\n " )
801+ for_editor += '\n ' .join (line [len (self .ps1 ):]
802+ if line .startswith (self .ps1 ) else
803+ line [len (self .ps2 ):]
804+ if line .startswith (self .ps2 ) else
805+ '### ' + line
806+ for line in self .getstdout ().split ('\n ' ))
807807 text = self .send_to_external_editor (for_editor )
808808 lines = text .split ('\n ' )
809809 from_editor = [line for line in lines if line [:4 ] != '### ' ]
@@ -1557,8 +1557,8 @@ def just_simple_events(event_list):
15571557 simple_events = []
15581558 for e in event_list :
15591559 # '\n' necessary for pastes
1560- if e in (u "<Ctrl-j>" , u "<Ctrl-m>" , u "<PADENTER>" , u "\n " , u "\r " ):
1561- simple_events .append (u '\n ' )
1560+ if e in ("<Ctrl-j>" , "<Ctrl-m>" , "<PADENTER>" , "\n " , "\r " ):
1561+ simple_events .append ('\n ' )
15621562 elif isinstance (e , events .Event ):
15631563 pass # ignore events
15641564 elif e == '<SPACE>' :
0 commit comments