globality-corp / flake8-logging-format

Flake8 extension to validate (lack of) logging format strings
Apache License 2.0
134 stars 21 forks source link

fix AttributeError on double-star dicts #50

Closed si14 closed 1 year ago

si14 commented 1 year ago

Dicts that use {'foo': "bar", **baz} syntax have key set to None for baz, we need to check it before accessing an attribute, otherwise we get an error like that:

  File "/Users/foobar/python3.10/site-packages/logging_format/visitor.py", line 149, in visit_Dict
    if key.s in RESERVED_ATTRS:
AttributeError: 'NoneType' object has no attribute 's'