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)