Skip to content

Commit 32e9b27

Browse files
Apply refurb suggestions
[FURB131]: Replace `del x[y]` with `x.pop(y)`
1 parent b289d74 commit 32e9b27

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

distutils/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class found in 'cmdclass' is used in place of the default, which is
132132
# our Distribution (see below).
133133
klass = attrs.get('distclass')
134134
if klass:
135-
del attrs['distclass']
135+
attrs.pop('distclass')
136136
else:
137137
klass = Distribution
138138

distutils/dir_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def remove_tree(directory, verbose=1, dry_run=0):
227227
# remove dir from cache if it's already there
228228
abspath = os.path.abspath(cmd[1])
229229
if abspath in _path_created:
230-
del _path_created[abspath]
230+
_path_created.pop(abspath)
231231
except OSError as exc:
232232
log.warning("error removing %s: %s", directory, exc)
233233

distutils/tests/test_archive_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def _breaks(*args, **kw):
289289
pass
290290
assert os.getcwd() == current_dir
291291
finally:
292-
del ARCHIVE_FORMATS['xxx']
292+
ARCHIVE_FORMATS.pop('xxx')
293293

294294
def test_make_archive_tar(self):
295295
base_dir = self._create_files()

0 commit comments

Comments
 (0)