Skip to content

Commit 46fb219

Browse files
committed
Drop dataclasses dependency
1 parent f799e83 commit 46fb219

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Lib/pdb.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
import traceback
9494
import linecache
9595
import _colorize
96-
import dataclasses
9796

9897
from contextlib import closing
9998
from 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-
25192512
class _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

Comments
 (0)