Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import of private function for flask 2.0.0 #910

Closed

Conversation

dougroyal
Copy link

Flask commit b146a13f633b0e2e26e3b8383b3db0feb563bc83

moved def _endpoint_from_view_func from src/flask/helpers.py to src/flask/scaffold.py

It looks like this will be released with flask 2.0.0

Flask commit b146a13f633b0e2e26e3b8383b3db0feb563bc83

moved `def _endpoint_from_view_func` from `src/flask/helpers.py` to `src/flask/scaffold.py`

It looks like this will be released with flask 2.0.0
from flask.helpers import _endpoint_from_view_func
except:
# Flask >= 2.0.0
from flask.scaffold import _endpoint_from_view_func
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we ditch the private method use and copy its implementation (which is just return view_func.__name__)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a better solution than importing a private function :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This work for me., Thanks.

@codectl
Copy link

codectl commented May 13, 2021

Why was this issue closed and the PR branch deleted? The patch has not been released.

@schuderer
Copy link

@rena2damas It has been fixed in PR #915 in a way that does not require importing private flask functions, but it has not been released yet.

@codectl
Copy link

codectl commented May 17, 2021

@schuderer the merged fix was only added after my comment was made

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants