Skip to content

Commit 37158f5

Browse files
committed
tests: fix test_pdb_interaction_continue_recursive with pdbpp
1 parent 612c378 commit 37158f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

testing/test_pdb.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,15 +528,13 @@ def do_debug(self, arg):
528528
import sys
529529
import types
530530
531-
newglobals = {
532-
'Pdb': self.__class__, # NOTE: different with pdb.Pdb
533-
'sys': sys,
534-
}
535531
if sys.version_info < (3, ):
536532
do_debug_func = pdb.Pdb.do_debug.im_func
537533
else:
538534
do_debug_func = pdb.Pdb.do_debug
539535
536+
newglobals = do_debug_func.__globals__.copy()
537+
newglobals['Pdb'] = self.__class__
540538
orig_do_debug = types.FunctionType(
541539
do_debug_func.__code__, newglobals,
542540
do_debug_func.__name__, do_debug_func.__defaults__,

0 commit comments

Comments
 (0)