-
Notifications
You must be signed in to change notification settings - Fork 774
Fix DeprecationWarning from classes in collections.abc #1134
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anyone unable to get the same warning locally, here's how:
- In ycmd root open
python -Wa
from ycmd.utils import HashableDict
I love how python is trying to hide away the deprecation warning...
Reviewed 1 of 1 files at r1, 1 of 1 files at r2.
Reviewable status: 1 of 2 LGTMs obtained
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here a simpler way: export PYTHONWARNINGS=all
and run vim!
Reviewable status: 1 of 2 LGTMs obtained
Codecov Report
@@ Coverage Diff @@
## master #1134 +/- ##
==========================================
+ Coverage 97.67% 97.67% +<.01%
==========================================
Files 90 90
Lines 7067 7068 +1
==========================================
+ Hits 6903 6904 +1
Misses 164 164 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 LGTMs obtained
ycmd/utils.py, line 31 at r2 (raw file):
from collections.abc import Mapping except ImportError: # pragma: no cover # Python < 3.3
Let's mark this Python 2, or something like that, since ycmd doesn't support python 3.0 to 3.3 and the only way to get here is running python 2.7.
It will be easier to spot once we drop python 2.7 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
Reviewed 1 of 1 files at r2.
Reviewable status: 1 of 2 LGTMs obtained
ycmd/utils.py, line 32 at r2 (raw file):
except ImportError: # pragma: no cover # Python < 3.3 from collections import Mapping # noqa
I would move this code in the if PY2
block further below.
This patch removes the following warning: /usr/share/nvim/runtime/third_party/ycmd/ycmd/utils.py:499: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working class HashableDict( collections.Mapping ): This warning is originated from python/cpython#5460
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 LGTMs obtained (and 1 stale)
ycmd/utils.py, line 32 at r2 (raw file):
Previously, micbou wrote…
I would move this code in the
if PY2
block further below.
Should be fixed now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status: 1 of 2 LGTMs obtained
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status:complete! 2 of 2 LGTMs obtained
@zzbot r+ |
📌 Commit 7089fec has been approved by |
Fix DeprecationWarning from classes in collections.abc This patch removes the following warning: ``` /usr/share/nvim/runtime/third_party/ycmd/ycmd/utils.py:499: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working class HashableDict( collections.Mapping ): ``` This warning is originated from python/cpython#5460 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/1134) <!-- Reviewable:end -->
☀️ Test successful - status-appveyor, status-travis |
This patch removes the following warning:
This warning is originated from python/cpython#5460
This change is