From 5aa9fd25f79a03284f80b3884cf4225508545bdd Mon Sep 17 00:00:00 2001 From: migueltorres Date: Tue, 9 Apr 2024 14:06:12 +0100 Subject: [PATCH] fix is_nice_character is_nice_character is a nested function defined in two places with different implementations. Fixed the one defined in _to_json_compatible_object to match the one in _to_yaml_impl --- dronecan/introspect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dronecan/introspect.py b/dronecan/introspect.py index 3f73734..4891a37 100644 --- a/dronecan/introspect.py +++ b/dronecan/introspect.py @@ -40,7 +40,7 @@ def _to_json_compatible_object_impl(obj): t = dronecan.get_dronecan_data_type(obj) if t.value_type.category == t.value_type.CATEGORY_PRIMITIVE: def is_nice_character(ch): - if ch.is_printable() or ch.isspace(): + if 32 <= ch <= 126: return True if ch in b'\n\r\t': return True