summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_regrtest.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-07-25 15:45:53 (GMT)
committerGitHub <noreply@github.com>2017-07-25 15:45:53 (GMT)
commit302bbbe9ba5c72559913e2ea006c921f698a729d (patch)
tree78ed5a4f6ed2bf2240d519fee8ef96396e4b81bd /Lib/test/test_regrtest.py
parent90addd6d1c1fde4ec12a6b554d1deacfac6a879c (diff)
downloadcpython-302bbbe9ba5c72559913e2ea006c921f698a729d.zip
cpython-302bbbe9ba5c72559913e2ea006c921f698a729d.tar.gz
cpython-302bbbe9ba5c72559913e2ea006c921f698a729d.tar.bz2
bpo-31009: Fix support.fd_count() on Windows (#2862)
* bpo-31009: Fix support.fd_count() on Windows On Windows, test.support.fd_count() now calls msvcrt.CrtSetReportMode() to not kill the process nor log any error on stderr on os.dup(fd) if the file descriptor is invalid. * Fix for release mode
Diffstat (limited to 'Lib/test/test_regrtest.py')
-rw-r--r--Lib/test/test_regrtest.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index f63ed64..b756839 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -835,22 +835,10 @@ class ArgsTestCase(BaseTestCase):
import os
import unittest
- # Issue #25306: Disable popups and logs to stderr on assertion
- # failures in MSCRT
- try:
- import msvcrt
- msvcrt.CrtSetReportMode
- except (ImportError, AttributeError):
- # no Windows, o release build
- pass
- else:
- for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
- msvcrt.CrtSetReportMode(m, 0)
-
class FDLeakTest(unittest.TestCase):
def test_leak(self):
fd = os.open(__file__, os.O_RDONLY)
- # bug: never cloes the file descriptor
+ # bug: never close the file descriptor
""")
self.check_leak(code, 'file descriptors')