From: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Date: Sat, 11 Oct 2025 14:31:34 +0000 (+0200) Subject: gh-139935: do not skip test on real errors in `os.getlogin` (#139953) X-Git-Tag: v3.15.0a1~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2eb32add92d553b320850975442fa2e55addc377;p=thirdparty%2FPython%2Fcpython.git gh-139935: do not skip test on real errors in `os.getlogin` (#139953) --- diff --git a/Lib/test/test_os/test_os.py b/Lib/test/test_os/test_os.py index 95b175db6fcd..e074858fe2ad 100644 --- a/Lib/test/test_os/test_os.py +++ b/Lib/test/test_os/test_os.py @@ -3204,13 +3204,7 @@ class LoginTests(unittest.TestCase): user_name = os.getlogin() except OSError as exc: # See https://man7.org/linux/man-pages/man3/getlogin.3.html#ERRORS. - allowed_errors = ( - # defined by POSIX - errno.EMFILE, errno.ENFILE, errno.ENXIO, errno.ERANGE, - # defined by Linux/glibc - errno.ENOENT, errno.ENOMEM, errno.ENOTTY, - ) - if exc.errno in allowed_errors: + if exc.errno in (errno.ENXIO, errno.ENOENT, errno.ENOTTY): self.skipTest(str(exc)) else: raise