Skip to content

Commit 4147bcd

Browse files
authored
Merge pull request #5204 from impact27/patch-8
PR: Fix calling pdb.pm() in a console
2 parents af5d407 + 7c3da49 commit 4147bcd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: spyder/utils/site/sitecustomize.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,15 @@ def user_return(self, frame, return_value):
437437

438438
@monkeypatch_method(pdb.Pdb, 'Pdb')
439439
def interaction(self, frame, traceback):
440-
if "sitecustomize.py" not in frame.f_code.co_filename:
440+
if frame is not None and "sitecustomize.py" in frame.f_code.co_filename:
441+
self.run('exit')
442+
else:
441443
self.setup(frame, traceback)
442444
if self.send_initial_notification:
443445
self.notify_spyder(frame)
444446
self.print_stack_entry(self.stack[self.curindex])
445447
self._cmdloop()
446448
self.forget()
447-
else:
448-
self.run('exit')
449449

450450

451451
@monkeypatch_method(pdb.Pdb, 'Pdb')

0 commit comments

Comments
 (0)