From ede2c3de60a9cd83d9addf785f631b4f939daabc Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 7 Mar 2022 11:55:01 -0800 Subject: [PATCH] HypergraphGenerators.nauty: Use NautyExecutable(...).absolute_filename() --- src/sage/graphs/hypergraph_generators.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)