twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
361 stars 74 forks source link

Lib not working in the newest versions of Python #156

Closed einekratzekatze closed 2 years ago

einekratzekatze commented 2 years ago

Fix for the Issue https://github.com/twoolie/NBT/issues/154 This could cause the same Error for older versions of Python afaik This is my first PR so please ask if I missed anything

macfreek commented 2 years ago

Thanks @einekratzekatze for the heads-up, and initial PR. I took your code and slightly modified it to: use collections.abc.* instead of typing.*, and also made sure that there is a fall-back for those 1 or 2 users still using Python 2.7 with collections.*. It's in the fix-python-3.10 branch. Let me know if this works, and I move it to master.

macfreek commented 2 years ago

As @twoolie, I'm not that active in maintaining, so a PR is really appreciated. Thanks again. PS: The reason not to merge to master right away is that the travis code verification seem broken. While I am confident this fix works, I'm a bit cautious to merge things I have not tested nor that the CI/CD has verified. We should probably use the Github actions which can do more (I do use that for my active projects). I'll try to find some time for that. For now, I would be grateful if you give it a manual test yourself.

einekratzekatze commented 2 years ago

tried with from nbt.nbt import TAG_List, TAG_Compound, NBTFile (only those functions are used) on python 3.10 and it behaves the same way as my fix