@@ -57,14 +57,14 @@ class CodeRunner:
5757 """Runs user code in an interpreter.
5858
5959 Running code requests a refresh by calling
60- request_from_main_context (force_refresh=True), which
60+ request_from_main_thread (force_refresh=True), which
6161 suspends execution of the code by blocking on a queue
6262 that the main thread was blocked on.
6363
6464 After load_code() is called with the source code to be run,
6565 the run_code() method should be called to start running the code.
6666 The running code may request screen refreshes and user input
67- by calling request_from_main_context .
67+ by calling request_from_main_thread .
6868 When this are called, the running source code cedes
6969 control, and the current run_code() method call returns.
7070
@@ -98,7 +98,7 @@ def __init__(self, interp=None, request_refresh=lambda: None):
9898 # waiting for response from main thread
9999 self .code_is_waiting = False
100100 # sigint happened while in main thread
101- self .sigint_happened_in_main_context = False # TODO rename context to thread
101+ self .sigint_happened_in_main_thread = False # TODO rename context to thread
102102 self .orig_sigint_handler = None
103103
104104 @property
@@ -142,8 +142,8 @@ def run_code(self, for_code=None):
142142 self .code_is_waiting = False
143143 if is_main_thread ():
144144 signal .signal (signal .SIGINT , self .sigint_handler )
145- if self .sigint_happened_in_main_context :
146- self .sigint_happened_in_main_context = False
145+ if self .sigint_happened_in_main_thread :
146+ self .sigint_happened_in_main_thread = False
147147 self .responses_for_code_thread .put (SigintHappened )
148148 else :
149149 self .responses_for_code_thread .put (for_code )
@@ -180,7 +180,7 @@ def sigint_handler(self, *args):
180180 "sigint while fulfilling code request sigint handler "
181181 "running!"
182182 )
183- self .sigint_happened_in_main_context = True
183+ self .sigint_happened_in_main_thread = True
184184
185185 def _blocking_run_code (self ):
186186 try :
@@ -192,7 +192,7 @@ def _blocking_run_code(self):
192192 if unfinished
193193 else Done ())
194194
195- def request_from_main_context (self , force_refresh = False ):
195+ def request_from_main_thread (self , force_refresh = False ):
196196 """Return the argument passed in to .run_code(for_code)
197197
198198 Nothing means calls to run_code must be... ???
@@ -223,7 +223,7 @@ def __init__(self, coderunner, on_write, real_fileobj):
223223
224224 def write (self , s , * args , ** kwargs ):
225225 self .on_write (s , * args , ** kwargs )
226- return self .coderunner .request_from_main_context (force_refresh = True )
226+ return self .coderunner .request_from_main_thread (force_refresh = True )
227227
228228 # Some applications which use curses require that sys.stdout
229229 # have a method called fileno. One example is pwntools. This
0 commit comments