Skip to content

Don't fail on missing optional fields - #6

Open
tjaffri wants to merge 1 commit into
akarazniewicz:masterfrom
tjaffri:patch-1
Open

tjaffri wants to merge 1 commit into
akarazniewicz:masterfrom
tjaffri:patch-1

Conversation

@tjaffri

@tjaffri tjaffri commented Oct 1, 2021

Copy link
Copy Markdown

No description provided.

@fedorukol

Copy link
Copy Markdown

I've run into same problem but I would suggest to do it more "pythonic" way by using Dict.get method. Added as code comments

Comment thread cocosplit.py
licenses = coco['licenses']
else:
licenses = []

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info = coco.get('info', {})
licenses = coco.get('licenses', [])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants