Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
HypergraphGenerators.nauty: Use NautyExecutable(...).absolute_filename()
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Mar 7, 2022
1 parent 2f1476f commit ede2c3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sage/graphs/hypergraph_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
Functions and methods
---------------------
"""
from sage.env import SAGE_NAUTY_BINS_PREFIX as nautyprefix

class HypergraphGenerators():
r"""
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ede2c3d

Please sign in to comment.