summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-08-18 10:16:07 (GMT)
committerGitHub <noreply@github.com>2022-08-18 10:16:07 (GMT)
commit1a720c600391f4076097f2ab667e9521c8e521fa (patch)
tree32552a93439ff45a903d787131ff1c89aa764644 /Lib/pdb.py
parent4a6fa894650cfd08da172b798a745961d4d0f398 (diff)
downloadcpython-1a720c600391f4076097f2ab667e9521c8e521fa.zip
cpython-1a720c600391f4076097f2ab667e9521c8e521fa.tar.gz
cpython-1a720c600391f4076097f2ab667e9521c8e521fa.tar.bz2
gh-95913: make the new internal classes pdb.ModuleTarget/ScriptTarget private (GH-96053)
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index e6ed814..b0acb1f 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -131,7 +131,7 @@ class _rstr(str):
return self
-class ScriptTarget(str):
+class _ScriptTarget(str):
def __new__(cls, val):
# Mutate self to be the "real path".
res = super().__new__(cls, os.path.realpath(val))
@@ -167,7 +167,7 @@ class ScriptTarget(str):
return f"exec(compile({fp.read()!r}, {self!r}, 'exec'))"
-class ModuleTarget(str):
+class _ModuleTarget(str):
def check(self):
try:
self._details
@@ -1625,7 +1625,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
return fullname
return None
- def _run(self, target: Union[ModuleTarget, ScriptTarget]):
+ def _run(self, target: Union[_ModuleTarget, _ScriptTarget]):
# When bdb sets tracing, a number of call and line events happen
# BEFORE debugger even reaches user's code (and the exact sequence of
# events depends on python version). Take special measures to
@@ -1789,7 +1789,7 @@ def main():
commands = [optarg for opt, optarg in opts if opt in ['-c', '--command']]
module_indicated = any(opt in ['-m'] for opt, optarg in opts)
- cls = ModuleTarget if module_indicated else ScriptTarget
+ cls = _ModuleTarget if module_indicated else _ScriptTarget
target = cls(args[0])
target.check()