Skip to content
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

Issue with python 3.10 #42

Open
mattiagiupponi opened this issue Jan 10, 2023 · 1 comment
Open

Issue with python 3.10 #42

mattiagiupponi opened this issue Jan 10, 2023 · 1 comment

Comments

@mattiagiupponi
Copy link

Hi,
I'm using python 3.10 and the library raised this issue due to an incompatibility:

  File "/usr/local/lib/python3.10/dist-packages/django/forms/boundfield.py", line 34, in __str__
    return self.as_widget()
  File "/usr/local/lib/python3.10/dist-packages/django/forms/boundfield.py", line 93, in as_widget
    return widget.render(
  File "/usr/local/lib/python3.10/dist-packages/django_admin_json_editor/admin.py", line 24, in render
    self.schema_updater(schema)
  File "/usr/local/lib/python3.10/dist-packages/django_admin_json_editor/admin.py", line 41, in schema_updater
    if isinstance(value, collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'

This way of importing the module has been deprecated since python 3.3:

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' has been deprecated since Python 3.3, and in 3.10 it will stop working

It should be enough to change the import statement from import collection to from collections.abc import Mapping

@mikespallino
Copy link

I know you're probably moved on from this problem, but this is not an issue with versions of this package >=0.2.0. The method containing the code in the traceback was removed in that release 0.1.5...0.2.0#diff-79b0fa4a0d3f5c2770a9c3d127215aab4937042f912d8f92c7573f784303aff6L37-L46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants