import subprocess
import sys
import math
-from distutils import spawn
+from distutils.spawn import find_executable
from migen.fhdl.structure import _Fragment
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.