From 1bba62a75a0ce825b66d6f06fbfe4d73ffc6d50a Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 7 May 2020 09:43:15 -0700 Subject: Remove remaining Python 2 references This changes two things in all applicable files: - Remove imports from __future__ - Change default shebangs from /usr/bin/env python to /usr/bin/env python3 --- host/python/CMakeLists.txt | 5 ++--- host/python/setup.py.in | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'host/python') diff --git a/host/python/CMakeLists.txt b/host/python/CMakeLists.txt index 0990e2582..04e637f2e 100644 --- a/host/python/CMakeLists.txt +++ b/host/python/CMakeLists.txt @@ -25,7 +25,7 @@ set(PYBIND11_INCLUDE_DIR include_directories(${PYBIND11_INCLUDE_DIR}) execute_process( COMMAND "${PYTHON_EXECUTABLE}" -c - "from __future__ import print_function\ntry:\n import numpy\n import os\n inc_path = numpy.get_include()\n if os.path.exists(os.path.join(inc_path, 'numpy', 'arrayobject.h')):\n print(inc_path, end='')\nexcept:\n pass" + "try:\n import numpy\n import os\n inc_path = numpy.get_include()\n if os.path.exists(os.path.join(inc_path, 'numpy', 'arrayobject.h')):\n print(inc_path, end='')\nexcept:\n pass" OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR) # Build pyuhd library @@ -99,8 +99,7 @@ else() # packages, and install to our prefix if(NOT DEFINED UHD_PYTHON_DIR) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c - "from __future__ import print_function;\ - from distutils import sysconfig;\ + "from distutils import sysconfig;\ print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}'));" OUTPUT_VARIABLE UHD_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/host/python/setup.py.in b/host/python/setup.py.in index 4d2df10a5..505e8d199 100755 --- a/host/python/setup.py.in +++ b/host/python/setup.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2017-2018 Ettus Research, a National Instruments Company # -- cgit v1.2.3