8000 [3.12] gh-121571: Do not use `EnvironmentError` in tests, use `OSErro… · python/cpython@e47fec0 · GitHub
[go: up one dir, main page]

Skip to content

Commit e47fec0

Browse files
[3.12] gh-121571: Do not use EnvironmentError in tests, use OSError instead (GH-121572) (#121575)
gh-121571: Do not use `EnvironmentError` in tests, use `OSError` instead (GH-121572) (cherry picked from commit e282236) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent ac4276c commit e47fec0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def skip_if_buildbot(reason=None):
386386
reason = 'not suitable for buildbots'
387387
try:
388388
isbuildbot = getpass.getuser().lower() == 'buildbot'
389-
except (KeyError, EnvironmentError) as err:
389+
except (KeyError, OSError) as err:
390390
warnings.warn(f'getpass.getuser() failed {err}.', RuntimeWarning)
391391
isbuildbot = False
392392
return unittest.skipIf(isbuildbot, reason)

Lib/test/test_subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ def open_fds():
14071407
t = threading.Thread(target=open_fds)
14081408
t.start()
14091409
try:
1410-
with self.assertRaises(EnvironmentError):
4D83 1410+
with self.assertRaises(OSError):
14111411
subprocess.Popen(NONEXISTING_CMD,
14121412
stdin=subprocess.PIPE,
14131413
stdout=subprocess.PIPE,

0 commit comments

Comments
 (0)
0