Skip to content

Commit bc4b9b6

Browse files
committed
Fix test on Windows: when get_config_var() returns None
1 parent 38d54d4 commit bc4b9b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_pyexpat.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,10 @@ def test_exception(self):
455455
# Change the current directory to the Python source code directory
456456
# if it is available.
457457
src_dir = sysconfig.get_config_var('abs_builddir')
458-
have_source = os.path.isdir(src_dir)
458+
if src_dir:
459+
have_source = os.path.isdir(src_dir)
460+
else:
461+
have_source = None
459462
if have_source:
460463
cm = os_helper.change_cwd(src_dir)
461464
else:

0 commit comments

Comments
 (0)