Skip to content

Commit

Permalink
Merge pull request #17679 from charris/backport-17553
Browse files Browse the repository at this point in the history
MAINT: Add check for Windows 10 version 2004 bug.
  • Loading branch information
charris committed Oct 30, 2020
2 parents fe59218 + 13ea468 commit 1acc498
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions numpy/__init__.py
Expand Up @@ -286,6 +286,26 @@ def _mac_os_check():
raise RuntimeError(msg)
del _mac_os_check

def _win_os_check():
"""
Quick Sanity check for Windows OS: look for fmod bug issue 16744.
 """
try:
a = arange(13 * 13, dtype= float64).reshape(13, 13)
a = a % 17 # calls fmod
linalg.eig(a)
except Exception:
msg = ("The current Numpy installation ({!r}) fails to "
"pass a sanity check due to a bug in the windows runtime. "
"See this issue for more information: "
"https://tinyurl.com/y3dm3h86")
raise RuntimeError(msg.format(__file__)) from None

if sys.platform == "win32" and sys.maxsize > 2**32:
_win_os_check()

del _win_os_check

# We usually use madvise hugepages support, but on some old kernels it
# is slow and thus better avoided.
# Specifically kernel version 4.6 had a bug fix which probably fixed this:
Expand Down

0 comments on commit 1acc498

Please sign in to comment.