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

Commit

Permalink
Trac #33213: replace SAGE_TMP in magma interface doctests.
Browse files Browse the repository at this point in the history
  • Loading branch information
orlitzky committed Feb 15, 2022
1 parent dabb1c7 commit c292ea8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sage/interfaces/magma.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,14 +1042,15 @@ def load(self, filename):
EXAMPLES::
sage: filename = os.path.join(SAGE_TMP, 'a.m')
sage: with open(filename, 'w') as f:
sage: from tempfile import NamedTemporaryFile as NTF
sage: with NTF(mode="w+t", suffix=".m", delete=False) as f:
....: _ = f.write('function f(n) return n^2; end function;\nprint "hi";')
sage: print(magma.load(filename)) # optional - magma
sage: print(magma.load(f.name)) # optional - magma
Loading ".../a.m"
hi
sage: magma('f(12)') # optional - magma
144
sage: os.remove(f.name)
"""
return self.eval('load "%s"' % filename)

Expand Down

0 comments on commit c292ea8

Please sign in to comment.