9393import traceback
9494import linecache
9595import _colorize
96- import dataclasses
9796
9897from contextlib import closing
9998from contextlib import contextmanager
@@ -2510,12 +2509,6 @@ def set_trace(*, header=None, commands=None):
25102509
25112510# Remote PDB
25122511
2513- @dataclasses .dataclass (frozen = True )
2514- class _InteractState :
2515- compiler : codeop .CommandCompiler
2516- ns : dict [str , typing .Any ]
2517-
2518-
25192512class _PdbServer (Pdb ):
25202513 def __init__ (self , sockfile , owns_sockfile = True , ** kwargs ):
25212514 self ._owns_sockfile = owns_sockfile
@@ -2753,10 +2746,10 @@ def _run_in_python_repl(self, lines):
27532746 save_displayhook = sys .displayhook
27542747 try :
27552748 sys .displayhook = self ._interact_displayhook
2756- code_obj = self ._interact_state . compiler (lines + "\n " )
2749+ code_obj = self ._interact_state [ " compiler" ] (lines + "\n " )
27572750 if code_obj is None :
27582751 raise SyntaxError ("Incomplete command" )
2759- exec (code_obj , self ._interact_state . ns )
2752+ exec (code_obj , self ._interact_state [ "ns" ] )
27602753 except :
27612754 self ._error_exc ()
27622755 finally :
@@ -2766,7 +2759,7 @@ def do_interact(self, arg):
27662759 # Prepare to run 'interact' mode code blocks, and trigger the client
27672760 # to start treating all input as Python commands, not PDB ones.
27682761 self .message ("*pdb interact start*" )
2769- self ._interact_state = _InteractState (
2762+ self ._interact_state = dict (
27702763 compiler = codeop .CommandCompiler (),
27712764 ns = {** self .curframe .f_globals , ** self .curframe .f_locals },
27722765 )
0 commit comments