From 6c410f3502e824b5ed145a9ea6f22aa52be81d6b Mon Sep 17 00:00:00 2001 From: Jiri Suchan Date: Tue, 26 Sep 2023 22:21:03 +0200 Subject: [PATCH] fix error message concating when unauthorized.message is None --- b2sdk/session.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/b2sdk/session.py b/b2sdk/session.py index 09fc23e17..95bb790a0 100644 --- a/b2sdk/session.py +++ b/b2sdk/session.py @@ -508,9 +508,7 @@ def _add_app_key_info_to_unauthorized(self, unauthorized): key_messages.append('with no restrictions') # Make a new message - new_message = unauthorized.message - if new_message == '': - new_message = 'unauthorized' + new_message = unauthorized.message or 'unauthorized' new_message += ' for application key ' + ', '.join(key_messages) return Unauthorized(new_message, unauthorized.code)