diff -up src/sage/libs/gap/test/main.c.orig src/sage/libs/gap/test/main.c --- src/sage/libs/gap/test/main.c.orig 2017-07-21 13:10:16.000000000 -0600 +++ src/sage/libs/gap/test/main.c 2017-11-24 10:40:06.024865775 -0700 @@ -22,7 +22,7 @@ void eval(char* cmd) { libgap_start_interaction(cmd); libgap_enter(); - libGAP_ReadEvalCommand(libGAP_BottomLVars); + libGAP_ReadEvalCommand(libGAP_BottomLVars, NULL); libGAP_ViewObjHandler(libGAP_ReadEvalResult); char* out = libgap_get_output(); libgap_exit(); diff -up src/sage/libs/gap/util.pyx.orig src/sage/libs/gap/util.pyx --- src/sage/libs/gap/util.pyx.orig 2017-07-21 13:10:16.000000000 -0600 +++ src/sage/libs/gap/util.pyx 2017-11-24 10:41:12.757621519 -0700 @@ -22,6 +22,8 @@ from sage.interfaces.gap_workspace impor from sage.env import SAGE_LOCAL, GAP_ROOT_DIR from .element cimport * +import re + ############################################################################ ### Hooking into the GAP memory management ################################# @@ -160,17 +162,9 @@ def gap_root(): sage: from sage.libs.gap.util import gap_root sage: gap_root() # random output - '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest' + '/usr/lib/gap' """ - import os.path - if os.path.exists(GAP_ROOT_DIR): - return GAP_ROOT_DIR - print('The gap-4.5.5.spkg (or later) seems to be not installed!') - gap_sh = open(os.path.join(SAGE_LOCAL, 'bin', 'gap')).read().splitlines() - gapdir = filter(lambda dir:dir.strip().startswith('GAP_DIR'), gap_sh)[0] - gapdir = gapdir.split('"')[1] - gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL) - return gapdir + return '/usr/lib/gap' cdef initialize(): @@ -224,6 +218,7 @@ cdef initialize(): libgap_initialize(argc, argv) gap_error_msg = str(libgap_get_output()) libgap_finish_interaction() + gap_error_msg = re.sub(r'#I.*\n?', '', gap_error_msg, flags=re.MULTILINE) if gap_error_msg: raise RuntimeError('libGAP initialization failed\n' + gap_error_msg)