Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions Lib/idlelib/pyshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
if sys.platform == 'win32':
try:
import ctypes
PROCESS_SYSTEM_DPI_AWARE = 1
PROCESS_SYSTEM_DPI_AWARE = 1 # Int required.
ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
except (ImportError, AttributeError, OSError):
pass
Expand Down Expand Up @@ -676,7 +676,6 @@ def execfile(self, filename, source=None):
def runsource(self, source):
"Extend base class method: Stuff the source in the line cache first"
filename = self.stuffsource(source)
self.more = 0
# at the moment, InteractiveInterpreter expects str
assert isinstance(source, str)
# InteractiveInterpreter.runsource() calls its runcode() method,
Expand Down Expand Up @@ -993,12 +992,12 @@ def open_debugger(self):
def beginexecuting(self):
"Helper for ModifiedInterpreter"
self.resetoutput()
self.executing = 1
self.executing = True

def endexecuting(self):
"Helper for ModifiedInterpreter"
self.executing = 0
self.canceled = 0
self.executing = False
self.canceled = False
self.showprompt()

def close(self):
Expand Down Expand Up @@ -1075,7 +1074,7 @@ def stop_readline(self):
def readline(self):
save = self.reading
try:
self.reading = 1
self.reading = True
self.top.mainloop() # nested mainloop()
finally:
self.reading = save
Expand All @@ -1087,11 +1086,11 @@ def readline(self):
line = "\n"
self.resetoutput()
if self.canceled:
self.canceled = 0
self.canceled = False
if not use_subprocess:
raise KeyboardInterrupt
if self.endoffile:
self.endoffile = 0
self.endoffile = False
line = ""
return line

Expand All @@ -1109,8 +1108,8 @@ def cancel_callback(self, event=None):
self.interp.write("KeyboardInterrupt\n")
self.showprompt()
return "break"
self.endoffile = 0
self.canceled = 1
self.endoffile = False
self.canceled = True
if (self.executing and self.interp.rpcclt):
if self.interp.getdebugger():
self.interp.restart_subprocess()
Expand All @@ -1130,8 +1129,8 @@ def eof_callback(self, event):
self.resetoutput()
self.close()
else:
self.canceled = 0
self.endoffile = 1
self.canceled = False
self.endoffile = True
self.top.quit()
return "break"

Expand Down Expand Up @@ -1303,7 +1302,7 @@ def write(self, s, tags=()):
raise ###pass # ### 11Aug07 KBK if we are expecting exceptions
# let's find out what they are and be specific.
if self.canceled:
self.canceled = 0
self.canceled = False
if not use_subprocess:
raise KeyboardInterrupt
return count
Expand Down