Fix collections imports for 3.10#57
Open
MichaelCook wants to merge 7 commits into
Open
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. |
Closed
| 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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of Python 3.10 in collections:
MutableMapping is now abc.MutableMapping
Container is now abc.Container
Issue #56