Skip to content

cattrs fails on pypy #253

@ygl-rg

Description

@ygl-rg
  • cattrs version: 22.1
  • Python version: 3.9.10 (Pypy 7.3.9)
  • Operating System: Windows 10

Description

cattrs fails to import.

raised error like this

TypeError: 'module' object is not iterable

in _compat.py, there is

  if "ExceptionGroup" not in __builtins__:
     from exceptiongroup import ExceptionGroup
  else:
    ExceptionGroup = ExceptionGroup

according to the pypy's doc https://doc.pypy.org/en/latest/cpython_differences.html

"the builtins name is always referencing the builtin module, never a dictionary as it sometimes is in CPython"

so "if "ExceptionGroup" not in builtins" is invalid on pypy

What I Did

  import cattrs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions