提交 00aac3f9 authored 作者: Oscar Gustafsson's avatar Oscar Gustafsson 提交者: Brandon T. Willard

Removed direct access to no longer existing config information

There was a direct access to a NumPy configuration which was removed in 1.22. This PR removes the special handling and rely on accessing the configuration in a controlled way to avoid later issues.
上级 ff4b91dd
...@@ -2622,28 +2622,23 @@ def default_blas_ldflags(): ...@@ -2622,28 +2622,23 @@ def default_blas_ldflags():
warn_record = [] warn_record = []
try: try:
if hasattr(numpy.distutils, "__config__") and numpy.distutils.__config__: # We do this import only here, as in some setup, if we
# If the old private interface is available use it as it # just import aesara and exit, with the import at global
# don't print information to the user. # scope, we get this error at exit: "Exception TypeError:
blas_info = numpy.distutils.__config__.blas_opt_info # "'NoneType' object is not callable" in <bound method
else: # Popen.__del__ of <subprocess.Popen object at 0x21359d0>>
# We do this import only here, as in some setup, if we # ignored"
# just import aesara and exit, with the import at global
# scope, we get this error at exit: "Exception TypeError: # This happen with Python 2.7.3 |EPD 7.3-1 and numpy 1.8.1
# "'NoneType' object is not callable" in <bound method # isort: off
# Popen.__del__ of <subprocess.Popen object at 0x21359d0>> import numpy.distutils.system_info # noqa
# ignored"
# We need to catch warnings as in some cases NumPy print
# This happen with Python 2.7.3 |EPD 7.3-1 and numpy 1.8.1 # stuff that we don't want the user to see.
# isort: off # I'm not able to remove all printed stuff
import numpy.distutils.system_info # noqa with warnings.catch_warnings(record=True):
numpy.distutils.system_info.system_info.verbosity = 0
# We need to catch warnings as in some cases NumPy print blas_info = numpy.distutils.system_info.get_info("blas_opt")
# stuff that we don't want the user to see.
# I'm not able to remove all printed stuff
with warnings.catch_warnings(record=True):
numpy.distutils.system_info.system_info.verbosity = 0
blas_info = numpy.distutils.system_info.get_info("blas_opt")
# If we are in a EPD installation, mkl is available # If we are in a EPD installation, mkl is available
if "EPD" in sys.version: if "EPD" in sys.version:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论