mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-32691: Use mod_spec.parent when running modules with pdb (GH-5474)
Previously the module name was used, which broke relative imports when pdb was run against a plain module or submodule.
This commit is contained in:
parent
4e9da0d163
commit
38bfa8418f
3 changed files with 34 additions and 2 deletions
|
|
@ -1532,7 +1532,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
|||
__main__.__dict__.update({
|
||||
"__name__": "__main__",
|
||||
"__file__": self.mainpyfile,
|
||||
"__package__": module_name,
|
||||
"__package__": mod_spec.parent,
|
||||
"__loader__": mod_spec.loader,
|
||||
"__spec__": mod_spec,
|
||||
"__builtins__": __builtins__,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue