Skip to content

Commit

Permalink
Migrate from legacy API of importlib_resources. (#165)
Browse files Browse the repository at this point in the history
importlib_resources.read_binary was removed, see
python/importlib_resources#282
  • Loading branch information
zamzterz committed Jul 20, 2023
1 parent 6072fc5 commit e874344
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flask_pyoidc/flask_pyoidc.py
Expand Up @@ -145,7 +145,7 @@ def _handle_authentication_response(self):
return self._handle_error_response({'error': 'unsolicited_response', 'error_description': 'No initialised user session.'})

if flask.session.pop('fragment_encoded_response', False):
return importlib_resources.read_binary('flask_pyoidc', 'parse_fragment.html').decode('utf-8')
return (importlib_resources.files('flask_pyoidc') / 'parse_fragment.html').read_text(encoding='utf-8')

if 'auth_request' not in flask.session:
return self._handle_error_response({'error': 'unsolicited_response', 'error_description': 'No authentication request stored.'})
Expand Down

0 comments on commit e874344

Please sign in to comment.