@@ -217,6 +217,7 @@ from .gap_includes cimport *
217
217
from .util cimport *
218
218
from .element cimport *
219
219
220
+ from sage.cpython.string cimport str_to_bytes
220
221
from sage.structure.parent cimport Parent
221
222
from sage.structure.element cimport Vector
222
223
from sage.rings.integer_ring import ZZ
@@ -478,9 +479,7 @@ class Gap(Parent):
478
479
1
479
480
sage: libgap.unset_global('FooBar')
480
481
sage: libgap.get_global('FooBar')
481
- Traceback (most recent call last):
482
- ...
483
- GAPError: Error, VAL_GVAR: No value bound to FooBar
482
+ NULL
484
483
"""
485
484
is_bound = self .function_factory(' IsBoundGlobal' )
486
485
bind_global = self .function_factory(' BindGlobal' )
@@ -503,9 +502,7 @@ class Gap(Parent):
503
502
1
504
503
sage: libgap.unset_global('FooBar')
505
504
sage: libgap.get_global('FooBar')
506
- Traceback (most recent call last):
507
- ...
508
- GAPError: Error, VAL_GVAR: No value bound to FooBar
505
+ NULL
509
506
"""
510
507
is_readonlyglobal = self .function_factory(' IsReadOnlyGlobal' )
511
508
make_readwrite = self .function_factory(' MakeReadWriteGlobal' )
@@ -535,12 +532,9 @@ class Gap(Parent):
535
532
1
536
533
sage: libgap.unset_global('FooBar')
537
534
sage: libgap.get_global('FooBar')
538
- Traceback (most recent call last):
539
- ...
540
- GAPError: Error, VAL_GVAR: No value bound to FooBar
535
+ NULL
541
536
"""
542
- value_global = self .function_factory(' ValueGlobal' )
543
- return value_global(variable)
537
+ return make_any_gap_element(self , GAP_ValueGlobalVariable(str_to_bytes(variable)))
544
538
545
539
def global_context (self , variable , value ):
546
540
"""
0 commit comments