build/xilinx/vivado: cleanup pull request #170
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 23 Apr 2019 03:33:56 +0000 (05:33 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 23 Apr 2019 03:33:56 +0000 (05:33 +0200)
litex/build/xilinx/vivado.py

index eac6c6b7f84485406607b2aacf4388d063a1651f..9eb08e2b6fb411a9e619471b33e1d3352a3829f2 100644 (file)
@@ -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.