-
Notifications
You must be signed in to change notification settings - Fork 19
Fix collections imports for 3.10 #57
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
base: master
Are you sure you want to change the base?
Conversation
As of Python 3.10 in collections: - MutableMapping is now abc.MutableMapping - Container is now abc.Container Issue staggerpkg#56
Fix import for Python 3.10
|
Looks fine to me :D But it looks like this package is dead, at least it has no maintainer, maybe @MichaelCook you could create a fork and ask Karoly Lorentey (karoly@lorentey.hu) if he could transfer the package to you. Or if he does not answer, you could create a "version 2" of it. |
| def imghdr_what(file, h): | ||
| # imhdr.what was deprecated in PEP-0594 | ||
| # See https://peps.python.org/pep-0594/#imghdr | ||
| return None |
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.
This leaves 2 tests failing:
FAILED test/friendly.py::FriendlyTestCase::testPicture22 - AssertionError: 'Other(0)::<60511 bytes of None data>' != 'Other(0)::<60511...
FAILED test/friendly.py::FriendlyTestCase::testPicture23_24 - AssertionError: 'Other(0)::<60511 bytes of None data>' != 'Other(0)::<60511...
The full messages:
________________________ FriendlyTestCase.testPicture22 ________________________
[…]
E AssertionError: 'Other(0)::<60511 bytes of None data>' != 'Other(0)::<60511 bytes of jpeg data>'
E - Other(0)::<60511 bytes of None data>
E ? ^^^
E + Other(0)::<60511 bytes of jpeg data>
E ? ^^ +
test/friendly.py:292: AssertionError
______________________ FriendlyTestCase.testPicture23_24 _______________________
[…]
E AssertionError: 'Other(0)::<60511 bytes of None data>' != 'Other(0)::<60511 bytes of jpeg data>'
E - Other(0)::<60511 bytes of None data>
E ? ^^^
E + Other(0)::<60511 bytes of jpeg data>
E ? ^^ +
test/friendly.py:318: AssertionError
One solution is to provide a fallback implementation of imghdr.what, as I did in macports/macports-ports 26385.
As of Python 3.10 in collections:
MutableMapping is now abc.MutableMapping
Container is now abc.Container
Issue #56