diff options
| author | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2022-11-20 20:16:07 +0100 |
|---|---|---|
| committer | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2022-12-28 14:09:04 +0100 |
| commit | 32e9b27a372fa2b3da372e4b4dbf66202f09f215 (patch) | |
| tree | 8e5cc8297e2f0a9627734eda6d8f3b86fcad40a4 | |
| parent | b289d7456d21a0a1c5c66dd4ee654e1ee4a0e027 (diff) | |
| download | python-setuptools-git-32e9b27a372fa2b3da372e4b4dbf66202f09f215.tar.gz | |
Apply refurb suggestions
[FURB131]: Replace `del x[y]` with `x.pop(y)`
| -rw-r--r-- | distutils/core.py | 2 | ||||
| -rw-r--r-- | distutils/dir_util.py | 2 | ||||
| -rw-r--r-- | distutils/tests/test_archive_util.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/distutils/core.py b/distutils/core.py index 34cafbce..05d29719 100644 --- a/distutils/core.py +++ b/distutils/core.py @@ -132,7 +132,7 @@ def setup(**attrs): # noqa: C901 # our Distribution (see below). klass = attrs.get('distclass') if klass: - del attrs['distclass'] + attrs.pop('distclass') else: klass = Distribution diff --git a/distutils/dir_util.py b/distutils/dir_util.py index 80f77649..23dc3392 100644 --- a/distutils/dir_util.py +++ b/distutils/dir_util.py @@ -227,7 +227,7 @@ def remove_tree(directory, verbose=1, dry_run=0): # remove dir from cache if it's already there abspath = os.path.abspath(cmd[1]) if abspath in _path_created: - del _path_created[abspath] + _path_created.pop(abspath) except OSError as exc: log.warning("error removing %s: %s", directory, exc) diff --git a/distutils/tests/test_archive_util.py b/distutils/tests/test_archive_util.py index 7778c3ad..89c415d7 100644 --- a/distutils/tests/test_archive_util.py +++ b/distutils/tests/test_archive_util.py @@ -289,7 +289,7 @@ class ArchiveUtilTestCase(support.TempdirManager): pass assert os.getcwd() == current_dir finally: - del ARCHIVE_FORMATS['xxx'] + ARCHIVE_FORMATS.pop('xxx') def test_make_archive_tar(self): base_dir = self._create_files() |
