Skip to content

Commit 6e61dbd

Browse files
committed
Fix example usage of Proto optionals
1 parent fbb8564 commit 6e61dbd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docs/source/generate_protobuf_docs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,8 @@ def _generate_usage_examples(self) -> str:
575575
if entry.HasField('saturation'):
576576
saturation_value = entry.saturation
577577
else:
578-
saturation_value = None
578+
saturation_value = "1*"
579579
580-
# Or use getattr with a default value
581-
saturation = getattr(entry, 'saturation', None)
582580
583581
Working with Vec3d and Vec3i
584582
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)