Skip to content

Python 3.7 compatibility broken #103

@Rulrn

Description

@Rulrn

What happened?

The recently added readers module has incompatible code for python3.7 in it's init.py (maybe in others module too, did not checked)

What are the steps to reproduce the bug?

$ python -c "import pdbufr.readers"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/pyve/venv/lib/python3.7/site-packages/pdbufr/__init__.py", line 20, in <module>
    from .readers.generic import stream_bufr
  File "/home/user/pyve/venv/lib/python3.7/site-packages/pdbufr/readers/__init__.py", line 79, in <module>
    class ReaderMaker:
  File "/home/user/pyve/venv/lib/python3.7/site-packages/pdbufr/readers/__init__.py", line 114, in ReaderMaker
    def get(self, name: str) -> type[Reader]:
TypeError: 'type' object is not subscriptable

This can be fixed by importing from typing import Type and replacing the signature. Or by importing from __future__ import annotations as it make new typing signatures python3.7 compatible.

Version

0.14.0

Platform (OS and architecture)

Linux - debian 10.11

Relevant log output

Accompanying data

No response

Organisation

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions