Skip to content

Regression: Import failure when Python docstrings are disabled #102

@JuneStepp

Description

@JuneStepp

Commit bb76d5a broke usage of this project with optimized Python code or when UntypedAtomic's doc string is missing for any reason. The specific code that causes this issue is:

if not cls.__doc__:
    if ver := getattr(cls, '_xsd_version', ''):
    ver = ver + ' '
    params = getattr(cls, '__init__', None).__doc__ or ''
    cls.__doc__ = f"Class for XSD{ver} {prefixed_name} builtin datatype.\n{params}"

The error is:

elementpath/datatypes/any_types.py", line 63, in __new__
    ver = ver + ' '
          ~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'member_descriptor' and 'str'

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