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

Show line which caused the DeprecationWarning #1831

Merged
merged 1 commit into from May 29, 2016

Conversation

iartarisi
Copy link

When raising a DeprecationWarning, show the line in the application code
which caused the warning, rather than the line in Flask

e.g. a file app.py with:

from flask import Flask
from flask.ext.babel import Babel

will show:

app.py:2: ExtDeprecationWarning: Importing flask.ext.babel is
deprecated, use flask_babel instead.

instead of:

/home/mapleoin/venv/local/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.babel is deprecated, use flask_babel instead.
  .format(x=modname), ExtDeprecationWarning

When raising a DeprecationWarning, show the line in the application code
which caused the warning, rather than the line in Flask

e.g. a file `app.py` with:

```python
from flask import Flask
from flask.ext.babel import Babel
```

will show:

```
app.py:2: ExtDeprecationWarning: Importing flask.ext.babel is
deprecated, use flask_babel instead.
```

instead of:

```
/home/mapleoin/venv/local/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.babel is deprecated, use flask_babel instead.
  .format(x=modname), ExtDeprecationWarning
```
@davidism davidism merged commit ba07f5b into pallets:master May 29, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants