Bug 1728671: Use gettempdir() instead of tempdir r=firefox-build-system-reviewers,glandium

The `tempfile.tempdir` cache value isn't always populated, but
`tempfile.gettempdir()` always is. They both provide the same result.

Differential Revision: https://phabricator.services.mozilla.com/D124261
This commit is contained in:
Mitchell Hentges 2021-09-03 13:13:21 +00:00
Родитель c87975af29
Коммит 80ed655270
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -41,7 +41,7 @@ class ConfigureTestVFS(object):
self._paths = set(mozpath.abspath(p) for p in paths)
def _real_file(self, path):
return mozpath.basedir(path, [topsrcdir, topobjdir, tempfile.tempdir])
return mozpath.basedir(path, [topsrcdir, topobjdir, tempfile.gettempdir()])
def exists(self, path):
if path in self._paths:

Просмотреть файл

@ -284,7 +284,7 @@ class TestWriteMozinfo(unittest.TestCase, Base):
MOZ_WIDGET_TOOLKIT="windows",
)
)
tempdir = tempfile.tempdir
tempdir = tempfile.gettempdir()
c.topsrcdir = tempdir
with NamedTemporaryFile(
dir=os.path.normpath(c.topsrcdir), mode="wt"