Skip to content

Commit 87a85df

Browse files
ulises-blacklanesebastinas
authored andcommitted
checking lines array length
1 parent f7d8b77 commit 87a85df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,9 +1004,9 @@ def send_session_to_external_editor(self, filename=None):
10041004
)
10051005
return
10061006
lines = text.split("\n")
1007-
if not lines[-1].strip():
1007+
if len(lines) and not lines[-1].strip():
10081008
lines.pop() # strip last line if empty
1009-
if lines[-1].startswith("### "):
1009+
if len(lines) and lines[-1].startswith("### "):
10101010
current_line = lines[-1][4:]
10111011
else:
10121012
current_line = ""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy