16
16
if sys .platform == 'win32' :
17
17
try :
18
18
import ctypes
19
- PROCESS_SYSTEM_DPI_AWARE = 1
19
+ PROCESS_SYSTEM_DPI_AWARE = 1 # Int required.
20
20
ctypes .OleDLL ('shcore' ).SetProcessDpiAwareness (PROCESS_SYSTEM_DPI_AWARE )
21
21
except (ImportError , AttributeError , OSError ):
22
22
pass
@@ -676,7 +676,6 @@ def execfile(self, filename, source=None):
676
676
def runsource (self , source ):
677
677
"Extend base class method: Stuff the source in the line cache first"
678
678
filename = self .stuffsource (source )
679
- self .more = 0
680
679
# at the moment, InteractiveInterpreter expects str
681
680
assert isinstance (source , str )
682
681
# InteractiveInterpreter.runsource() calls its runcode() method,
@@ -993,12 +992,12 @@ def open_debugger(self):
993
992
def beginexecuting (self ):
994
993
"Helper for ModifiedInterpreter"
995
994
self .resetoutput ()
996
- self .executing = 1
995
+ self .executing = True
997
996
998
997
def endexecuting (self ):
999
998
"Helper for ModifiedInterpreter"
1000
- self .executing = 0
1001
- self .canceled = 0
999
+ self .executing = False
1000
+ self .canceled = False
1002
1001
self .showprompt ()
1003
1002
1004
1003
def close (self ):
@@ -1075,7 +1074,7 @@ def stop_readline(self):
1075
1074
def readline (self ):
1076
1075
save = self .reading
1077
1076
try :
1078
- self .reading = 1
1077
+ self .reading = True
1079
1078
self .top .mainloop () # nested mainloop()
1080
1079
finally :
1081
1080
self .reading = save
@@ -1087,11 +1086,11 @@ def readline(self):
1087
1086
line = "\n "
1088
1087
self .resetoutput ()
1089
1088
if self .canceled :
1090
- self .canceled = 0
1089
+ self .canceled = False
1091
1090
if not use_subprocess :
1092
1091
raise KeyboardInterrupt
1093
1092
if self .endoffile :
1094
- self .endoffile = 0
1093
+ self .endoffile = False
1095
1094
line = ""
1096
1095
return line
1097
1096
@@ -1109,8 +1108,8 @@ def cancel_callback(self, event=None):
1109
1108
self .interp .write ("KeyboardInterrupt\n " )
1110
1109
self .showprompt ()
1111
1110
return "break"
1112
- self .endoffile = 0
1113
- self .canceled = 1
1111
+ self .endoffile = False
1112
+ self .canceled = True
1114
1113
if (self .executing and self .interp .rpcclt ):
1115
1114
if self .interp .getdebugger ():
1116
1115
self .interp .restart_subprocess ()
@@ -1130,8 +1129,8 @@ def eof_callback(self, event):
1130
1129
self .resetoutput ()
1131
1130
self .close ()
1132
1131
else :
1133
- self .canceled = 0
1134
- self .endoffile = 1
1132
+ self .canceled = False
1133
+ self .endoffile = True
1135
1134
self .top .quit ()
1136
1135
return "break"
1137
1136
@@ -1303,7 +1302,7 @@ def write(self, s, tags=()):
1303
1302
raise ###pass # ### 11Aug07 KBK if we are expecting exceptions
1304
1303
# let's find out what they are and be specific.
1305
1304
if self .canceled :
1306
- self .canceled = 0
1305
+ self .canceled = False
1307
1306
if not use_subprocess :
1308
1307
raise KeyboardInterrupt
1309
1308
return count
0 commit comments