diff options
author | Christian Heimes <christian@python.org> | 2022-03-07 14:36:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 13:36:47 +0100 |
commit | ca9689f8dac01d27e041e1dbbdae146746d48ab3 (patch) | |
tree | c6dcb89cc77ea1faf55abf4d664349669808eb31 /Lib/distutils | |
parent | 3b3be05a164da43f201e35b6dafbc840993a4d18 (diff) | |
download | cpython-git-ca9689f8dac01d27e041e1dbbdae146746d48ab3.tar.gz |
bpo-46933: Make pwd module optional (GH-31700)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/tests/test_util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_util.py b/Lib/distutils/tests/test_util.py index 812d44ec9b..f9c223f06e 100644 --- a/Lib/distutils/tests/test_util.py +++ b/Lib/distutils/tests/test_util.py @@ -248,7 +248,10 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase): util._environ_checked = 0 os.environ.pop('HOME', None) - import pwd + try: + import pwd + except ImportError: + raise unittest.SkipTest("Test requires pwd module.") # only set pw_dir field, other fields are not used result = pwd.struct_passwd((None, None, None, None, None, |