mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-139935: do not skip test on real errors in os.getlogin (#139953)
This commit is contained in:
parent
897a36badd
commit
2eb32add92
1 changed files with 1 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue