[Fix] browse_dataset.py not working in python3.10#533
[Fix] browse_dataset.py not working in python3.10#533RangiLyu merged 1 commit intoopen-mmlab:dev-1.xfrom
Conversation
ABCs were moved from collections to collections.abc in 3.3. Since 3.10, ABCs cannot be imported directly from collections.
916431f to
2711303
Compare
|
Hi @k-papadakis !First of all, we want to express our gratitude for your significant PR in the MMRotate project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR. We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/raweFPmdzG If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:) |
ABCs were moved from collections to collections.abc in 3.3. Since 3.10, ABCs cannot be imported directly from collections.
Motivation
The script does not work with Python 3.10. The reason is that the abstract base classes in the
collectionsmodule were moved tocollections.abcin Python 3.3. Until 3.9, importing an abstract base class fromcollectionsproduced a deprecation warning, and in 3.10 it produces an error.Modification
If version < 3.3 import from
collectionselse import fromcollections.abc.