Skip to content

Commit

Permalink
Fix #66: Replace pkg_resources with importlib_resources. (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
zamzterz authored Dec 10, 2019
1 parent a85d2b1 commit bad554b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
install_requires=[
'oic==1.1.2',
'Flask',
'requests'
'requests',
'importlib_resources'
],
package_data={'flask_pyoidc': ['files/parse_fragment.html']},
package_data={'flask_pyoidc': ['parse_fragment.html']},
long_description=long_description,
long_description_content_type='text/markdown',
)
4 changes: 2 additions & 2 deletions src/flask_pyoidc/flask_pyoidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import logging

import flask
import pkg_resources
import importlib_resources
from flask import current_app
from flask.helpers import url_for
from oic import rndstr
Expand Down Expand Up @@ -125,7 +125,7 @@ def _handle_authentication_response(self):
return 'Something went wrong.'

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

is_processing_fragment_encoded_response = flask.request.method == 'POST'

Expand Down
File renamed without changes.

0 comments on commit bad554b

Please sign in to comment.