Skip to content

Commit 0751f4c

Browse files
committed
Fix Nauty path on Windows
Fix for SAGE_NAUTY_BINS_PREFIX = "D:\a\_temp\msys64\ucrt64\bin\.EXE" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 17-19: truncated \uXXXX escape
1 parent bac6034 commit 0751f4c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/sage/config.py.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ NTL_LIBDIR = "@NTL_LIBDIR@"
3434
# Path to the ecl-config script
3535
ECL_CONFIG = "@SAGE_ECL_CONFIG@".replace("${prefix}", SAGE_LOCAL)
3636

37-
# Path to the nauty binaries; of the form "/path/to/" or "/path/to/nauty-"
38-
SAGE_NAUTY_BINS_PREFIX = "@SAGE_NAUTY_BINS_PREFIX@"
37+
# Path to the nauty binaries; of the form "/path/to" or "/path/to/nauty-"
38+
SAGE_NAUTY_BINS_PREFIX = r"@SAGE_NAUTY_BINS_PREFIX@"
3939

4040
SAGE_ECMBIN = "@SAGE_ECMBIN@"
4141

src/sage/meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ foreach prog : nauty_progs
7979
)
8080
endif
8181
if nauty_check.found()
82-
nauty_bins_prefix = nauty_check.full_path().replace(prog, '')
82+
nauty_bins_prefix = nauty_check.full_path().replace(prog + '.EXE', '').replace(
83+
prog,
84+
'',
85+
).strip(
86+
'\\/',
87+
)
8388
endif
8489
endforeach
8590
conf_data.set('SAGE_NAUTY_BINS_PREFIX', nauty_bins_prefix)

0 commit comments

Comments
 (0)