From: Jeremy Stanley Date: Sun, 1 Nov 2020 16:48:25 +0000 (+0000) Subject: Use PosixPath arguments with os.remove() X-Git-Tag: 0.4.0~18 X-Git-Url: https://mudpy.org/gitweb?a=commitdiff_plain;h=a75fa6326ef030ad1dbbe25171c75180f93e657c;p=mudpy.git Use PosixPath arguments with os.remove() Starting with Python 3.6, it's possible to pass a PosixPath to the os.remove function instead of having to use the .name attribute. --- diff --git a/mudpy/tests/selftest.py b/mudpy/tests/selftest.py index ede3cb2..bb19d33 100644 --- a/mudpy/tests/selftest.py +++ b/mudpy/tests/selftest.py @@ -477,9 +477,7 @@ def start_service(config): # Clean up any previous test output for f in pathlib.Path(".").glob("capture_*.log"): - # have to use .name here since remove() doesn't support passing a - # PosixPath argument until Python3.6 - os.remove(f.name) + os.remove(f) for d in ("data", "var"): shutil.rmtree(d, ignore_errors=True)