mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Fix bad syntax for adding finalizers
This commit is contained in:
parent
2fbb0ab7a5
commit
b26e771865
1 changed files with 2 additions and 5 deletions
|
|
@ -39,11 +39,8 @@ class ServerMixin:
|
|||
)
|
||||
s = self.storage_class(**args)
|
||||
if not list(s.list()):
|
||||
request.addfinalizer(
|
||||
# Ignoreng flake8-bugbear false positive.
|
||||
# See: https://github.com/PyCQA/flake8-bugbear/issues/269
|
||||
lambda: s.session.request("DELETE", "") # noqa: B023
|
||||
)
|
||||
# See: https://stackoverflow.com/a/33984811
|
||||
request.addfinalizer(lambda x=s: x.session.request("DELETE", ""))
|
||||
return args
|
||||
|
||||
raise RuntimeError("Failed to find free collection.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue