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

Commit

Permalink
GraphGenerators.nauty_geng: Use NautyExecutable(geng).absolute_filena…
Browse files Browse the repository at this point in the history
…me()
  • Loading branch information
Matthias Koeppe committed Mar 7, 2022
1 parent 7c1d96f commit 2f1476f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sage/graphs/graph_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
More interestingly, one can get the list of all graphs that Sage knows how to
build by typing ``graphs.`` in Sage and then hitting tab.
"""
from sage.env import SAGE_NAUTY_BINS_PREFIX as nautyprefix

import subprocess

Expand Down Expand Up @@ -956,8 +955,10 @@ def nauty_geng(self, options="", debug=False):
sage: list(graphs.nauty_geng("-c 3", debug=True))
['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
"""

sp = subprocess.Popen(nautyprefix+"geng {0}".format(options), shell=True,
import shlex
from sage.features.nauty import NautyExecutable
geng_path = NautyExecutable("geng").absolute_filename()
sp = subprocess.Popen(shlex.quote(geng_path) + " {0}".format(options), shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, close_fds=True,
encoding='latin-1')
Expand Down

0 comments on commit 2f1476f

Please sign in to comment.