From 7353701ad212c56e5de952a38ed9edbfd85034e0 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 24 Mar 2018 22:00:36 +0100 Subject: [PATCH] Try to use backports for python2. Reverse priority order for netcdf_c++ --- external/external_build.cmake | 2 +- python/cosmotool/smooth.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/external/external_build.cmake b/external/external_build.cmake index 0b07227..ae8d0e8 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -210,7 +210,7 @@ ELSE(INTERNAL_NETCDF) find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h) find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf) find_library(NETCDF_LIBRARY netcdf) - find_library(NETCDFCPP_LIBRARY NAMES netcdf_c++ netcdf_c++4) + find_library(NETCDFCPP_LIBRARY NAMES netcdf_c++4 netcdf_c++) SET(CONFIGURE_CPP_FLAGS "${CONFIGURE_CPP_FLAGS} -I${NETCDF_INCLUDE_PATH} -I${NETCDFCPP_INCLUDE_PATH}") endif (INTERNAL_NETCDF) diff --git a/python/cosmotool/smooth.py b/python/cosmotool/smooth.py index 7c39a75..418ca5d 100644 --- a/python/cosmotool/smooth.py +++ b/python/cosmotool/smooth.py @@ -1,7 +1,11 @@ from .config import install_prefix import subprocess import os -from tempfile import TemporaryDirectory +try: + from tempfile import TemporaryDirectory +except: + from backports.tempfile import TemporaryDirectory + import h5py as h5 import numpy as np import weakref