Skip to content

Commit 7d97f68

Browse files
authored
Update libgap.pyx
now returning NULL for undefined GAP variables, instead of raising GapError
1 parent 2697eed commit 7d97f68

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/sage/libs/gap/libgap.pyx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,7 @@ class Gap(Parent):
479479
1
480480
sage: libgap.unset_global('FooBar')
481481
sage: libgap.get_global('FooBar')
482-
Traceback (most recent call last):
483-
...
484-
GAPError: Error, VAL_GVAR: No value bound to FooBar
482+
NULL
485483
"""
486484
is_bound = self.function_factory('IsBoundGlobal')
487485
bind_global = self.function_factory('BindGlobal')
@@ -504,9 +502,7 @@ class Gap(Parent):
504502
1
505503
sage: libgap.unset_global('FooBar')
506504
sage: libgap.get_global('FooBar')
507-
Traceback (most recent call last):
508-
...
509-
GAPError: Error, VAL_GVAR: No value bound to FooBar
505+
NULL
510506
"""
511507
is_readonlyglobal = self.function_factory('IsReadOnlyGlobal')
512508
make_readwrite = self.function_factory('MakeReadWriteGlobal')
@@ -536,9 +532,7 @@ class Gap(Parent):
536532
1
537533
sage: libgap.unset_global('FooBar')
538534
sage: libgap.get_global('FooBar')
539-
Traceback (most recent call last):
540-
...
541-
GAPError: Error, VAL_GVAR: No value bound to FooBar
535+
NULL
542536
"""
543537
return make_any_gap_element(self, GAP_ValueGlobalVariable(str_to_bytes(variable)))
544538

0 commit comments

Comments
 (0)