Skip to content

Commit 4687bc9

Browse files
maigimenezvstinner
authored andcommitted
bpo-28655: Fix test bdb for isolate mode (GH-10220)
Fix test_bdb when running Python is isolated mode. (cherry picked from commit c0799ec)
1 parent 0a53a06 commit 4687bc9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_bdb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,13 @@ def gen(a, b):
526526
test.id = lambda : None
527527
test.expect_set = list(gen(repeat(()), iter(sl)))
528528
with create_modules(modules):
529-
sys.path.append(os.getcwd())
530529
with TracerRun(test, skip=skip) as tracer:
531530
tracer.runcall(tfunc_import)
532531

533532
@contextmanager
534533
def create_modules(modules):
535534
with test.support.temp_cwd():
535+
sys.path.append(os.getcwd())
536536
try:
537537
for m in modules:
538538
fname = m + '.py'
@@ -544,6 +544,7 @@ def create_modules(modules):
544544
finally:
545545
for m in modules:
546546
test.support.forget(m)
547+
sys.path.pop()
547548

548549
def break_in_func(funcname, fname=__file__, temporary=False, cond=None):
549550
return 'break', (fname, None, temporary, cond, funcname)

0 commit comments

Comments
 (0)