From 115c842ef029f98effd2273aa96ecc1a40948f09 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 23 Apr 2019 05:33:56 +0200 Subject: [PATCH] build/xilinx/vivado: cleanup pull request #170 --- litex/build/xilinx/vivado.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/litex/build/xilinx/vivado.py b/litex/build/xilinx/vivado.py index eac6c6b7..9eb08e2b 100644 --- a/litex/build/xilinx/vivado.py +++ b/litex/build/xilinx/vivado.py @@ -5,7 +5,7 @@ import os import subprocess import sys import math -from distutils import spawn +from distutils.spawn import find_executable from migen.fhdl.structure import _Fragment @@ -65,10 +65,8 @@ def _run_vivado(build_name, vivado_path, source, ver=None): command = build_script_file else: build_script_contents = "# Autogenerated by Migen\nset -e\n" - - # No reason to search for vivado if it's already in our $PATH - # https://stackoverflow.com/questions/377017/test-if-executable-exists-in-python - if not spawn.find_executable("vivado"): + # Only source Vivado settings if not already in our $PATH + if not find_executable("vivado"): # For backwards compatibility with ISE paths, also # look for a version in a subdirectory named "Vivado" # under the current directory. -- 2.30.2