From f930977a3487f254820d02e6b2e4ee3fc2a0b2c1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 16 Dec 2019 10:27:27 -0500 Subject: [PATCH] BF: lgr - use .setLevel() instead of .level = Apparently .level is not even a property and I guess starting from 3.7 treatment has changed, or broke. May be smth like (scheduled for 3.9 with backport requests for 3.8) https://github.com/python/cpython/pull/16325 was intended to fix it, I did not investigate deep enough -- just fixed the issue we started to experience (Closes #3545) --- datalad/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datalad/utils.py b/datalad/utils.py index 14769374ce..f98775f764 100644 --- a/datalad/utils.py +++ b/datalad/utils.py @@ -1290,7 +1290,8 @@ def assert_logged(self, msg=None, level=None, regex=True, **kwargs): # TODO: if file_ and there was an exception -- most probably worth logging it? # although ideally it should be the next log outside added to that file_ ... oh well finally: - lgr.handlers, lgr.level = old_handlers, old_level + lgr.handlers = old_handlers + lgr.setLevel(old_level) adapter.cleanup()