Skip to content
Merged
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
Windows doesn't have os.uname()
  • Loading branch information
vstinner committed Feb 3, 2022
commit 370ab52a1e2ffa1766c1c844b5d429861f9fb35a
4 changes: 2 additions & 2 deletions Lib/test/test_zlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
# zlib.decompress(func1()) == zlib.decompress(func2()) == datasrc
#
# Make the assumption that s390x always has an accelerator to simplify the
# skip condition.
skip_on_s390x = unittest.skipIf(os.uname().machine == 's390x',
# skip condition. Don't skip on Windows which doesn't have os.uname().
skip_on_s390x = unittest.skipIf(hasattr(os, 'uname') and os.uname().machine == 's390x',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To implementing Petr's comment suggestion:

Suggested change
skip_on_s390x = unittest.skipIf(hasattr(os, 'uname') and os.uname().machine == 's390x',
def not_s390x():
return not (hasattr(os, 'uname') and os.uname().machine == 's390x')

and replace @skip...s below with if not_s390x: on asserts.

'skipped on s390x')


Expand Down