Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
Do not use deprecated template variable in tempfile module (#45)
Browse files Browse the repository at this point in the history
* Do not use deprecated template variable in tempfile module

Use gettempprefix() instead, as suggested by the documentation.

* fix: Styling

Co-authored-by: Markus Unterwaditzer <[email protected]>
  • Loading branch information
untitaker authored Mar 15, 2020
2 parents 55eed75 + 7930174 commit 4705e84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atomicwrites/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ def _open(self, get_fileobject):
except Exception:
pass

def get_fileobject(self, suffix="", prefix=tempfile.template, dir=None,
**kwargs):
def get_fileobject(self, suffix="", prefix=tempfile.gettempprefix(),
dir=None, **kwargs):
'''Return the temporary file to use.'''
if dir is None:
dir = os.path.normpath(os.path.dirname(self._path))
Expand Down

0 comments on commit 4705e84

Please sign in to comment.