Skip to content

Deprecated way of checking an empty list #27

@bgodfrey

Description

@bgodfrey

On line 426 of scripts/python/xml2vhdl-ox/xml2vhdl/helper/slave.py, there is the line:

if tree_dict[bit_path] != []:

This throws an exception if the object is not a list for Python version >= 3.12. A few ways to change it:

  1. Cast the tree_dict[bit_path] as a list
  2. if len(tree_dict[bit_path]) > 0:
    I think that this will fail for empty multidimensional arrays though
  3. If you know that the array is a numpy array, then you change check if tree_dict[bit_path].size > 0

There are probably more. Raising as an issue since I'm not sure how we want to (or if we want to) fix it.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions