Skip to content

Commit

Permalink
src/sage/combinat/words/words.py: replace tmp_dir()
Browse files Browse the repository at this point in the history
Standard tempfile.TemporaryDirectory() replacement.

Issue: sagemath#36322
  • Loading branch information
orlitzky committed Sep 24, 2023
1 parent 80f6d77 commit e25aa25
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/sage/combinat/words/words.py
Original file line number Diff line number Diff line change
Expand Up @@ -1635,11 +1635,12 @@ def __setstate__(self, state):
r"""
TESTS::
sage: import os
sage: import os, tempfile
sage: W = Words('ab')
sage: filename = os.path.join(tmp_dir(), 'test.sobj')
sage: W.save(filename)
sage: load(filename)
sage: with tempfile.TemporaryDirectory() as d:
....: filename = os.path.join(d, 'test.sobj')
....: W.save(filename)
....: load(filename)
Finite and infinite words over {'a', 'b'}
"""
# add a default to support old pickles from #19619
Expand Down Expand Up @@ -2100,11 +2101,12 @@ def __setstate__(self, state):
r"""
TESTS::
sage: import os
sage: import os, tempfile
sage: W = Words('ab', 10)
sage: filename = os.path.join(tmp_dir(), 'test.sobj')
sage: W.save(filename)
sage: load(filename)
sage: with tempfile.TemporaryDirectory() as d:
....: filename = os.path.join(d, 'test.sobj')
....: W.save(filename)
....: load(filename)
Words of length 10 over {'a', 'b'}
"""
# add a default to support old pickles from #19619
Expand Down

0 comments on commit e25aa25

Please sign in to comment.