8000 bpo-46587: Skip tests if strftime does not support glibc extension (GH-31873) by tiran · Pull Request #31873 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46587: Skip tests if strftime does not support glibc extension (GH-31873) #31873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
8000
Catch invalid format string
  • Loading branch information
tiran committed Mar 15, 2022
commit 0e06f2c95de2f94554da750c89bad83422f03c8a
5 changes: 4 additions & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,10 @@ def requires_subprocess():
return unittest.skipUnless(has_subprocess_support, "requires subprocess support")

# Does strftime() support glibc extension like '%4Y'?
has_strftime_extensions = time.strftime("%4Y") != "%4Y"
try:
has_strftime_extensions = time.strftime("%4Y") != "%4Y"
except ValueError:
has_strftime_extensions = False

# Define the URL of a dedicated HTTP server for the network tests.
# The URL must use clear-text HTTP: no redirection to encrypted HTTPS.
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def test_print_warning(self):
'Warning -- a\nWarning -- b\n')

def test_has_strftime_extensions(self):
if support.is_emscripten or support.is_wasi:
if support.is_emscripten or support.is_wasi or sys.platform == "win32":
self.assertFalse(support.has_strftime_extensions)
else:
self.assertTrue(support.has_strftime_extensions)
Expand Down
0