diff options
author | 2022-09-24 21:42:58 +0300 | |
---|---|---|
committer | 2022-09-24 21:42:58 +0300 | |
commit | 19e9e33ee43437e7bf77a3a2b71341354f18cd30 (patch) | |
tree | 05901dea877cb792c1c9198887caa7956ccb5143 /src/snakeoil | |
parent | Revert "dist.distutils_extensions: fix _verinfo.py file" (diff) | |
download | snakeoil-19e9e33ee43437e7bf77a3a2b71341354f18cd30.tar.gz snakeoil-19e9e33ee43437e7bf77a3a2b71341354f18cd30.tar.bz2 snakeoil-19e9e33ee43437e7bf77a3a2b71341354f18cd30.zip |
test/mixins: remove `mk_named_tempfile`
Last usage was removed, so we can remove the function as well. For tests
just use normal `tmp_path / [filename]` instead.
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'src/snakeoil')
-rw-r--r-- | src/snakeoil/test/mixins.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/snakeoil/test/mixins.py b/src/snakeoil/test/mixins.py index 03360ab9..aa66839c 100644 --- a/src/snakeoil/test/mixins.py +++ b/src/snakeoil/test/mixins.py @@ -1,19 +1,12 @@ import errno import inspect -import io import os import stat import sys -import tempfile from ..compatibility import IGNORED_EXCEPTIONS -def mk_named_tempfile(*args, **kwds): - tmp_f = tempfile.NamedTemporaryFile(*args, **kwds) - return io.TextIOWrapper(tmp_f) - - class PythonNamespaceWalker: ignore_all_import_failures = False @@ -91,8 +84,7 @@ class PythonNamespaceWalker: seen = set(['__init__']) for x, st in stats: if not (x.startswith(".") or x.endswith("~")) and stat.S_ISREG(st): - if (x.endswith(".py") or x.endswith(".pyc") - or x.endswith(".pyo") or x.endswith(".so")): + if x.endswith((".py", ".pyc", ".pyo", ".so")): y = x.rsplit(".", 1)[0] # Ensure we're not looking at a >=py3k .so which injects # the version name in... |