diff --git a/src/sage/graphs/hypergraph_generators.py b/src/sage/graphs/hypergraph_generators.py index 0894d5110bf..03b4c4343e0 100644 --- a/src/sage/graphs/hypergraph_generators.py +++ b/src/sage/graphs/hypergraph_generators.py @@ -30,7 +30,6 @@ Functions and methods --------------------- """ -from sage.env import SAGE_NAUTY_BINS_PREFIX as nautyprefix class HypergraphGenerators(): r""" @@ -149,6 +148,9 @@ def nauty(self, number_of_sets, number_of_vertices, raise ValueError("cannot have more than 64 sets+vertices") import subprocess + import shlex + from sage.features.nauty import NautyExecutable + genbgL_path = NautyExecutable("genbgL").absolute_filename() nauty_input = options @@ -181,7 +183,7 @@ def nauty(self, number_of_sets, number_of_vertices, nauty_input += " " + str(number_of_vertices) + " " + str(number_of_sets) + " " - sp = subprocess.Popen(nautyprefix + "genbgL {0}".format(nauty_input), shell=True, + sp = subprocess.Popen(shlex.quote(genbgL_path) + " {0}".format(nauty_input), shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)