summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorMario Corchero <mariocj89@gmail.com>2018-02-03 06:40:11 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2018-02-03 06:40:11 (GMT)
commit38bfa8418f5d39bcc7478b8f7aef4a632c26172e (patch)
tree33c7f43db19885633bbbc0f66cf46d9c74cb9de3 /Lib/pdb.py
parent4e9da0d163731caa79811c723c703ee416c31826 (diff)
downloadcpython-38bfa8418f5d39bcc7478b8f7aef4a632c26172e.zip
cpython-38bfa8418f5d39bcc7478b8f7aef4a632c26172e.tar.gz
cpython-38bfa8418f5d39bcc7478b8f7aef4a632c26172e.tar.bz2
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.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 366a85b..60bdb76 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -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__,